:root {
  color-scheme: light;
  --bg: #fff8fb;
  --panel: #ffffff;
  --ink: #111111;
  --muted: #68606a;
  --line: #eadde4;
  --pink: #f2bfd4;
  --pink-strong: #d93672;
  --black: #0d0d0f;
  --shadow: 0 10px 30px rgba(17, 17, 17, 0.08);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

::selection {
  background: rgba(242, 191, 212, 0.72);
  color: var(--black);
}

::-moz-selection {
  background: rgba(242, 191, 212, 0.72);
  color: var(--black);
}

html,
body {
  margin: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  overscroll-behavior: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  touch-action: manipulation;
}

html {
  position: fixed;
  inset: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  font-size: 16px;
  touch-action: manipulation;
}

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.view,
.view:focus,
.view:focus-visible,
button,
button:focus,
button:focus-visible {
  outline: none;
}

.app-shell {
  position: fixed;
  inset: 0;
  width: min(100%, 860px);
  height: var(--app-height, 100svh);
  min-height: 0;
  max-height: var(--app-height, 100svh);
  margin: 0 auto;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 12px 12px calc(82px + env(safe-area-inset-bottom));
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable both-edges;
}

.app-shell.has-admin-switch {
  padding-bottom: calc(154px + env(safe-area-inset-bottom));
}

.app-shell.is-admin-mode {
  padding-top: 12px;
  padding-bottom: calc(88px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0 8px;
  background: linear-gradient(180deg, var(--bg) 78%, rgba(255, 248, 251, 0));
}

.brand-lockup,
.cart-pill {
  border: 0;
  background: transparent;
  color: var(--ink);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.brand-lockup strong {
  display: block;
  font-size: 15px;
  line-height: 1.1;
}

.brand-lockup small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.brand-mark {
  display: grid;
  position: relative;
  width: 40px;
  height: 40px;
  place-items: center;
  flex: 0 0 auto;
  overflow: hidden;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  font-family: Georgia, serif;
  font-size: 19px;
}

.brand-mark img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-mark img ~ span {
  display: none;
}

.top-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  min-width: 0;
}

.cart-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--black);
  border-radius: 999px;
  background: #fff;
  font-size: 13px;
}

.admin-switch {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  padding: 0 11px;
  font-size: 12px;
  font-weight: 800;
}

.admin-switch.is-active {
  background: #fff;
  color: var(--rose-dark);
}

.admin-mode-bar {
  position: fixed;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: 12px;
  z-index: 40;
  max-width: 820px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid rgba(224, 24, 98, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.admin-mode-switch {
  display: flex;
  width: 100%;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--black), var(--pink-strong));
  color: #fff;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 900;
}

.admin-mode-switch.is-active {
  background: linear-gradient(135deg, #fff, #fff0f6);
  color: var(--rose-dark);
  box-shadow: inset 0 0 0 1px rgba(224, 24, 98, 0.2);
}

.admin-mode-switch .ui-icon {
  width: 19px;
  height: 19px;
}

.cart-pill b {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: var(--pink-strong);
  color: #fff;
  font-size: 12px;
}

.department-tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(118px, 1fr);
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  scrollbar-width: none;
}

.department-tabs::-webkit-scrollbar {
  display: none;
}

.department-tab {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  text-align: left;
  padding: 9px 10px;
  box-shadow: none;
}

.department-tab strong,
.department-tab small {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.department-tab strong {
  font-size: 14px;
}

.department-tab small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
}

.department-tab.is-active {
  border-color: var(--black);
  background: var(--black);
  color: #fff;
}

.department-tab.is-active small {
  color: #f4dbe6;
}

.view {
  max-width: 820px;
  margin: 0 auto;
}

.hero-panel {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero-panel h1,
.section-title h1,
.product-title {
  margin: 0;
  color: var(--black);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(26px, 7vw, 42px);
  line-height: 1;
  font-weight: 500;
}

.hero-panel p,
.muted {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.summary-item {
  padding: 10px;
  border-radius: 8px;
  background: #fff1f7;
  min-width: 0;
}

.summary-item b,
.summary-item span {
  display: block;
}

.summary-item b {
  font-size: 16px;
}

.summary-item span {
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filters {
  display: grid;
  gap: 8px;
  margin: 12px 0;
}

.search-input,
.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  min-height: 42px;
  padding: 0 12px;
  outline: none;
}

.field textarea {
  min-height: 82px;
  padding-top: 10px;
  resize: vertical;
}

.search-input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--pink-strong);
  box-shadow: 0 0 0 3px rgba(217, 54, 114, 0.12);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.field label {
  display: block;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 11px;
}

.field small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.product-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  min-height: 214px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 10px;
  text-align: left;
  color: var(--ink);
  box-shadow: none;
}

.product-card:active {
  transform: none;
}

.product-visual {
  position: relative;
  display: grid;
  min-height: 92px;
  place-items: center;
  overflow: hidden;
  border-radius: 6px;
  background: linear-gradient(135deg, #111 0%, #111 48%, #f8d0df 49%, #fff 100%);
}

.product-visual .product-initials {
  display: grid;
  width: 48px;
  height: 62px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-family: Georgia, serif;
  font-size: 20px;
  backdrop-filter: blur(6px);
}

.product-card h2 {
  margin: 0;
  font-size: 14px;
  line-height: 1.2;
}

.product-card-copy {
  display: grid;
  align-content: start;
  gap: 6px;
  min-width: 0;
}

.product-brand {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.product-card-facts {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  align-self: end;
  min-width: 0;
  min-height: 24px;
}

.product-origin {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.product-card-facts .badge {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-card-facts .badge + .product-origin::before {
  content: "·";
  color: var(--muted);
}

.image-stock-badge {
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 2;
  width: auto;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 999px;
  background: rgba(255, 248, 251, 0.92);
  color: var(--rose-dark);
  box-shadow: 0 10px 22px rgba(20, 9, 16, 0.14);
  padding: 5px 8px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.meta-line,
.price-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.price-line b {
  color: var(--black);
  font-size: 14px;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 8px;
  background: #fff;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.badge.dark {
  border-color: var(--black);
  background: var(--black);
  color: #fff;
}

.badge.pink {
  border-color: var(--pink);
  background: #fff1f7;
  color: #9f2450;
}

.section-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 12px;
}

.section-title h1 {
  font-size: 30px;
}

.back-button,
.primary-button,
.secondary-button,
.icon-button,
.option-button {
  min-height: 42px;
  border-radius: 8px;
  border: 1px solid var(--black);
  padding: 0 14px;
}

.primary-button {
  background: var(--black);
  color: #fff;
}

.secondary-button,
.back-button,
.icon-button,
.option-button {
  background: #fff;
  color: var(--black);
}

.primary-button:disabled,
.secondary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.product-detail {
  display: grid;
  gap: 12px;
}

.detail-visual {
  min-height: 190px;
  border-radius: 8px;
}

.detail-block {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.detail-block h2 {
  margin: 0 0 8px;
  font-size: 15px;
}

.detail-block p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.variant-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.option-button {
  display: grid;
  gap: 3px;
  height: auto;
  min-height: 58px;
  text-align: left;
}

.option-button.is-active {
  border-color: var(--pink-strong);
  background: #fff1f7;
}

.option-button small {
  color: var(--muted);
}

.cart-list {
  display: grid;
  gap: 10px;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.cart-item h2 {
  margin: 0 0 4px;
  font-size: 14px;
}

.qty-row {
  display: inline-grid;
  grid-template-columns: 36px 36px 36px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.qty-row button {
  height: 36px;
  border: 0;
  background: #fff;
}

.qty-row span {
  text-align: center;
  font-weight: 700;
}

.total-panel {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  background: var(--black);
  color: #fff;
}

.total-panel div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.checkout-form {
  display: grid;
  gap: 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.empty-state,
.loading,
.error-state {
  padding: 24px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.error-state {
  border-color: #e47a9e;
  color: #941842;
}

.bottom-nav {
  position: fixed;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: 12px;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  max-width: 820px;
  margin: 0 auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.app-shell.has-admin-switch .bottom-nav {
  bottom: calc(84px + env(safe-area-inset-bottom));
}

.bottom-nav button {
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.bottom-nav button.is-active {
  background: var(--black);
  color: #fff;
}

@media (min-width: 720px) {
  .app-shell {
    padding-right: 22px;
    padding-left: 22px;
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filters {
    grid-template-columns: minmax(220px, 1fr) 2fr;
  }

  .filter-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 420px) {
  .filter-grid,
  .form-grid,
  .variant-grid,
  .summary-row {
    grid-template-columns: 1fr;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* Compact boutique pass */
.catalog-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 10px;
}

.catalog-head h1,
.admin-head h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  line-height: 1;
  font-weight: 500;
}

.catalog-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.certificate-banner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  margin: 4px 0 12px;
  padding: 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, #0d0d0f 0%, #0d0d0f 68%, #ffd8e7 68%, #ffffff 100%);
  color: #fff;
  box-shadow: 0 12px 26px rgba(13, 13, 15, 0.16);
}

.certificate-banner span {
  color: #f5bfd3;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.certificate-banner h1 {
  margin: 2px 0 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  font-weight: 500;
}

.certificate-banner p {
  max-width: 420px;
  margin: 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 12px;
  line-height: 1.35;
}

.certificate-button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #0d0d0f;
  padding: 0 16px;
  font-weight: 700;
}

.search-row {
  display: grid;
}

.search-input {
  min-height: 46px;
  border-color: #0d0d0f;
  color: #0d0d0f;
  font-size: 15px;
}

.quick-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.quick-row button,
.secondary-button.compact {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #0d0d0f;
  padding: 0 8px;
  font-size: 12px;
}

.filter-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.field label {
  margin-bottom: 3px;
}

.field input,
.field select {
  min-height: 38px;
  padding: 0 9px;
  font-size: 13px;
}

.product-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.product-card {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto 1fr auto;
  align-items: stretch;
  min-height: 212px;
  gap: 10px;
  border-color: var(--line);
  background: #fff;
  color: var(--ink);
  padding: 10px;
}

.product-card h2 {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.2;
}

.product-card-copy {
  gap: 7px;
}

.product-card .meta-line {
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
}

.product-card .price-line {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
}

.product-card .price-line b {
  color: var(--ink);
  white-space: nowrap;
}

.product-card .badge {
  max-width: 100%;
  border-color: var(--line);
  background: #fff;
  color: var(--muted);
}

.product-card .badge.pink {
  border-color: var(--pink);
  background: #fff1f7;
  color: #9f2450;
}

.product-visual {
  width: 100%;
  aspect-ratio: 4 / 5;
  min-height: 0;
  background: linear-gradient(135deg, #111 0%, #111 48%, #f8d0df 49%, #fff 100%);
}

.product-visual .product-initials {
  width: 48px;
  height: 62px;
  border-color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 20px;
}

.product-visual img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.product-visual.has-image {
  background: #fff;
}

.product-visual.has-image .product-initials {
  display: none;
}

.detail-visual {
  width: 100%;
  aspect-ratio: 4 / 5;
  max-height: min(62vh, 520px);
  min-height: 0;
  background: linear-gradient(135deg, #0d0d0f 0%, #0d0d0f 58%, #f4bed3 58%, #fff 100%);
}

.detail-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.admin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.admin-head span {
  border-radius: 999px;
  background: #0d0d0f;
  color: #fff;
  padding: 7px 10px;
  font-size: 12px;
}

.admin-tools {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.admin-tool {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-height: 64px;
  border: 1px solid rgba(224, 24, 98, 0.16);
  border-radius: 10px;
  background: #fff;
  color: var(--black);
  padding: 10px;
  text-align: left;
  box-shadow: 0 10px 24px rgba(20, 9, 16, 0.06);
}

.admin-tool.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--black), var(--rose-dark) 58%, var(--pink-strong));
  color: #fff;
  box-shadow: var(--shadow);
}

.admin-tool-icon {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 9px;
  background: #fff0f6;
  color: var(--pink-strong);
}

.admin-tool.is-active .admin-tool-icon {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.admin-tool-text {
  min-width: 0;
}

.admin-tool-text b,
.admin-tool-text small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-tool-text b {
  font-size: 13px;
}

.admin-tool-text small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.admin-tool.is-active .admin-tool-text small {
  color: rgba(255, 255, 255, 0.7);
}

.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.admin-stat {
  border-radius: 8px;
  background: #0d0d0f;
  color: #fff;
  padding: 12px;
}

.admin-stat b,
.admin-stat span {
  display: block;
}

.admin-stat b {
  font-size: 20px;
}

.admin-stat span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.65);
  font-size: 11px;
}

.admin-orders {
  display: grid;
  gap: 8px;
}

.admin-order {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  padding: 10px;
  border-radius: 8px;
  background: #fff8fb;
}

.admin-order b,
.admin-order span {
  display: block;
}

.admin-order span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.settings-list {
  display: grid;
  gap: 8px;
}

.setting-row {
  display: grid;
  grid-template-columns: minmax(0, 0.7fr) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 8px;
  background: #fff8fb;
}

.setting-row span,
.setting-row b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.setting-row span {
  color: var(--muted);
  font-size: 12px;
}

.setting-row b {
  color: var(--black);
  text-align: right;
  font-size: 13px;
}

.stock-list {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow: auto;
  padding-right: 2px;
}

.stock-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(224, 24, 98, 0.14);
  border-radius: 8px;
  background: #fff;
}

.stock-row b,
.stock-row span {
  display: block;
}

.stock-row b {
  color: var(--black);
  font-size: 13px;
}

.stock-row span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.stock-row > div:last-child {
  min-width: 82px;
  text-align: right;
}

.stock-row.is-ok {
  border-color: rgba(14, 124, 85, 0.18);
}

.stock-row.is-low {
  border-color: rgba(243, 172, 18, 0.45);
  background: linear-gradient(135deg, #fffaf0, #fff);
}

.stock-row.is-low > div:last-child b,
.stock-row.is-low > div:last-child span {
  color: #9b4f00;
}

.stock-row.is-out {
  border-color: rgba(112, 112, 122, 0.16);
  background: #f7f7f8;
}

.stock-row.is-out b,
.stock-row.is-out span {
  color: #7b7b84;
}

.inventory-start {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  background:
    linear-gradient(120deg, #0b0b0d 0%, #54122f 56%, #e01862 100%);
  color: #fff;
  box-shadow: var(--shadow-strong);
}

.inventory-start > div {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

.inventory-start h2,
.inventory-panel h2 {
  margin: 0;
  font-size: 18px;
}

.inventory-start p {
  margin: 3px 0 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
}

.inventory-icon {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.inventory-panel {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(224, 24, 98, 0.16);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.inventory-panel-head,
.inventory-summary-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inventory-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.7fr);
  gap: 8px;
}

.inventory-summary-line {
  min-height: 34px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fff8fb;
  color: var(--muted);
  font-size: 12px;
}

.inventory-summary-line b {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--rose-dark);
}

.inventory-list {
  display: grid;
  gap: 8px;
  max-height: 520px;
  overflow: auto;
  padding-right: 2px;
}

.inventory-row {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid rgba(224, 24, 98, 0.14);
  border-radius: 10px;
  background: #fff;
}

.inventory-row.is-warning {
  border-color: rgba(224, 24, 98, 0.4);
  background: linear-gradient(135deg, #fff2f7, #fff);
}

.inventory-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.inventory-row-main b,
.inventory-row-main span,
.inventory-row-main small {
  display: block;
}

.inventory-row-main b {
  color: var(--black);
  font-size: 13px;
}

.inventory-row-main span,
.inventory-row-main small {
  color: var(--muted);
  font-size: 12px;
}

.inventory-numbers {
  min-width: 92px;
  text-align: right;
}

.inventory-numbers b {
  color: var(--pink-strong);
  font-size: 16px;
}

.inventory-controls {
  display: grid;
  gap: 7px;
}

.ml-control {
  display: grid;
  grid-template-columns: 48px 44px minmax(62px, 1fr) 44px 48px;
  gap: 5px;
}

.ml-control button,
.ml-presets button {
  display: inline-flex;
  min-width: 0;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: 1px solid rgba(224, 24, 98, 0.16);
  border-radius: 8px;
  background: #fff8fb;
  color: var(--rose-dark);
  font-size: 12px;
  font-weight: 800;
}

.ml-control .ui-icon {
  width: 13px;
  height: 13px;
}

.ml-control input {
  width: 100%;
  min-width: 0;
  min-height: 36px;
  border: 1px solid var(--black);
  border-radius: 8px;
  background: #fff;
  color: var(--black);
  text-align: center;
  font-weight: 800;
}

.ml-presets {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.inventory-warning {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  background: #fff0f6;
  color: var(--pink-strong);
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.inventory-result {
  display: grid;
  gap: 2px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid rgba(14, 124, 85, 0.18);
  border-radius: 10px;
  background: linear-gradient(135deg, #effbf6, #fff);
}

.inventory-result b {
  color: #0e7c55;
}

.inventory-result span {
  color: var(--muted);
  font-size: 12px;
}

@media (min-width: 720px) {
  .admin-tools {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .certificate-banner {
    grid-template-columns: 1fr;
  }

  .certificate-button {
    width: 100%;
  }

  .inventory-start,
  .inventory-toolbar,
  .inventory-row-main {
    grid-template-columns: 1fr;
  }

  .inventory-start > button {
    width: 100%;
  }

  .inventory-numbers {
    text-align: left;
  }
}

@media (max-width: 420px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}

/* Viewport stability: no iOS focus zoom, no tap-induced layout movement. */
input,
select,
textarea,
.search-input,
.field input,
.field select,
.field textarea {
  font-size: 16px;
}

button,
.product-card,
.department-tab,
.option-button,
.bottom-nav button {
  transform: none;
}

/* Lively boutique pass */
:root {
  --bg: #fff5fa;
  --panel: #ffffff;
  --ink: #101012;
  --muted: #6f6570;
  --line: #ead7e2;
  --pink: #f3a7c4;
  --pink-strong: #e01862;
  --rose-dark: #7d123d;
  --peach: #ffd0b8;
  --lilac: #d9ccff;
  --mint: #d8f1e8;
  --gold: #f3cc7d;
  --black: #0b0b0d;
  --shadow: 0 16px 38px rgba(20, 9, 16, 0.12);
  --shadow-strong: 0 20px 46px rgba(20, 9, 16, 0.2);
}

body {
  background:
    linear-gradient(135deg, rgba(255, 245, 250, 0.96) 0%, rgba(255, 255, 255, 0.92) 42%, rgba(216, 241, 232, 0.42) 100%),
    linear-gradient(45deg, rgba(255, 208, 184, 0.42), rgba(217, 204, 255, 0.36));
}

.ui-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}

.icon-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.topbar {
  margin: 0 0 8px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(11, 11, 13, 0.96) 0%, rgba(125, 18, 61, 0.92) 55%, rgba(224, 24, 98, 0.86) 100%);
  box-shadow: var(--shadow-strong);
  color: #fff;
}

.brand-lockup,
.cart-pill {
  color: #fff;
}

.brand-lockup {
  gap: 11px;
}

.brand-lockup strong {
  color: #fff;
  font-size: 16px;
  letter-spacing: 0.4px;
}

.brand-lockup small {
  color: rgba(255, 255, 255, 0.72);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 0;
  box-shadow: none;
}

.cart-pill {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
}

.cart-pill b {
  background: #fff;
  color: var(--pink-strong);
}

.certificate-banner {
  grid-template-columns: auto minmax(0, 1fr) auto;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(120deg, #09090b 0%, #51112f 42%, #e01862 72%, #ffd0b8 100%);
  box-shadow: var(--shadow-strong);
}

.certificate-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(110deg, transparent 0 55%, rgba(255, 255, 255, 0.18) 55% 56%, transparent 56% 100%);
}

.certificate-banner > * {
  position: relative;
  z-index: 1;
}

.certificate-icon {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.certificate-icon .ui-icon {
  width: 24px;
  height: 24px;
}

.certificate-button {
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: #fff;
  color: var(--rose-dark);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
}

.department-tab {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  border-color: rgba(224, 24, 98, 0.15);
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, rgba(224, 24, 98, 0.34), rgba(255, 208, 184, 0.5), rgba(216, 241, 232, 0.42)) border-box;
  box-shadow: 0 10px 24px rgba(20, 9, 16, 0.06);
}

.department-icon {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 8px;
  background: #fff0f6;
  color: var(--pink-strong);
}

.department-tab.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--black), var(--rose-dark) 58%, var(--pink-strong));
  box-shadow: var(--shadow);
}

.department-tab.is-active .department-icon {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.catalog-head h1,
.admin-head h1,
.section-title h1,
.product-title {
  color: var(--black);
}

.catalog-head h1::after {
  content: "";
  display: block;
  width: 54px;
  height: 4px;
  margin-top: 8px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--pink-strong), var(--peach), var(--mint));
}

.search-row {
  position: relative;
}

.search-row .ui-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  z-index: 1;
  color: var(--pink-strong);
  transform: translateY(-50%);
}

.search-input {
  border-color: transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, var(--pink-strong), var(--peach), var(--mint)) border-box;
  padding-left: 42px;
  box-shadow: 0 10px 24px rgba(20, 9, 16, 0.07);
}

.field label {
  color: var(--rose-dark);
  font-weight: 700;
}

.field select,
.field input,
.field textarea {
  border-color: rgba(224, 24, 98, 0.16);
  background: rgba(255, 255, 255, 0.9);
}

.filter-menu {
  position: relative;
  min-width: 0;
}

.filter-menu summary {
  display: grid;
  min-height: 48px;
  align-content: center;
  gap: 2px;
  border: 1px solid rgba(224, 24, 98, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--rose-dark);
  padding: 7px 10px;
  cursor: pointer;
  list-style: none;
}

.filter-menu summary::-webkit-details-marker {
  display: none;
}

.filter-menu summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.filter-menu summary b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--black);
  font-size: 13px;
}

.filter-options {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  z-index: 25;
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
  border: 1px solid rgba(224, 24, 98, 0.18);
  border-radius: 12px;
  background: #fff;
  padding: 8px;
  box-shadow: var(--shadow-strong);
}

.filter-options button,
.sort-pills button {
  min-height: 36px;
  border: 1px solid rgba(224, 24, 98, 0.14);
  border-radius: 8px;
  background: #fff8fb;
  color: var(--black);
  padding: 0 9px;
  text-align: left;
  font-size: 13px;
}

.filter-options button.is-active,
.sort-pills button.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--black), var(--pink-strong));
  color: #fff;
}

.sort-pills {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.sort-pills button {
  text-align: center;
  font-weight: 800;
}

.product-card {
  overflow: hidden;
  border: 1px solid transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, rgba(224, 24, 98, 0.42), rgba(255, 208, 184, 0.4), rgba(216, 241, 232, 0.42)) border-box;
  box-shadow: 0 12px 30px rgba(20, 9, 16, 0.1);
}

.product-card h2 {
  font-weight: 750;
}

.product-visual {
  border-radius: 8px;
  background:
    linear-gradient(135deg, #0b0b0d 0%, #611239 50%, #ffd0b8 100%);
}

.product-visual.has-image::after,
.detail-visual.has-image::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(11, 11, 13, 0), rgba(11, 11, 13, 0.18));
}

.price-line span,
.admin-head span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.price-line b {
  color: var(--pink-strong);
  font-weight: 800;
}

.badge {
  border-color: rgba(224, 24, 98, 0.16);
  background: #fff8fb;
}

.badge.dark {
  background: linear-gradient(135deg, var(--black), var(--rose-dark));
}

.badge.pink,
.product-card .badge.pink {
  border-color: rgba(224, 24, 98, 0.26);
  background: linear-gradient(135deg, #fff0f6, #fff8fb);
  color: var(--rose-dark);
}

.stock-label {
  font-weight: 800;
}

.stock-label.is-ok {
  color: #0e7c55;
}

.stock-label.is-low {
  color: #b25b00;
}

.stock-label.is-out {
  color: #8b8b96;
}

.badge.stock-warning,
.product-card .badge.stock-warning {
  border-color: rgba(243, 172, 18, 0.45);
  background: linear-gradient(135deg, #fff6db, #fff2ed);
  color: #9b4f00;
  font-weight: 800;
}

.primary-button {
  border: 0;
  background: linear-gradient(135deg, var(--black), var(--rose-dark) 58%, var(--pink-strong));
  box-shadow: 0 12px 26px rgba(125, 18, 61, 0.22);
}

.secondary-button,
.back-button,
.icon-button,
.option-button {
  border-color: rgba(224, 24, 98, 0.2);
}

.option-button.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, #fff0f6, #fff9fb 62%, #fff1df);
  box-shadow: 0 10px 22px rgba(224, 24, 98, 0.12);
}

.detail-block,
.cart-item,
.empty-state,
.loading {
  border-color: rgba(224, 24, 98, 0.16);
  box-shadow: 0 10px 24px rgba(20, 9, 16, 0.07);
}

.certificate-form,
.certificate-card {
  display: grid;
  gap: 10px;
  margin-bottom: 12px;
  border: 1px solid rgba(224, 24, 98, 0.16);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(20, 9, 16, 0.07);
}

.certificate-form > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}

.certificate-form h2,
.certificate-card h3 {
  margin: 0;
  color: var(--black);
}

.certificate-form p,
.certificate-card p,
.certificate-letter {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.certificate-list {
  display: grid;
  gap: 10px;
}

.certificate-card {
  margin-bottom: 0;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, rgba(224, 24, 98, 0.34), rgba(255, 208, 184, 0.44), rgba(216, 241, 232, 0.44)) border-box;
  border-color: transparent;
}

.certificate-card.is-active {
  background:
    linear-gradient(135deg, rgba(255, 248, 251, 0.96), rgba(255, 255, 255, 0.96)) padding-box,
    linear-gradient(135deg, var(--black), var(--pink-strong), var(--peach)) border-box;
}

.certificate-card.is-highlighted {
  box-shadow: 0 14px 32px rgba(224, 24, 98, 0.16);
}

.certificate-card-main {
  display: grid;
  gap: 10px;
  align-items: start;
}

.certificate-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.certificate-info-item {
  display: grid;
  min-width: 0;
  gap: 3px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  padding: 9px;
}

.certificate-info-item small {
  color: rgba(13, 13, 15, 0.46);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.certificate-info-item b {
  min-width: 0;
  overflow: hidden;
  color: var(--black);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.certificate-qr {
  width: 96px;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 4px;
}

.certificate-letter {
  border-top: 1px solid var(--line);
  padding-top: 8px;
  white-space: pre-line;
}

.certificate-message {
  border-radius: 8px;
  background: rgba(224, 24, 98, 0.07);
  padding: 9px;
  color: rgba(13, 13, 15, 0.68);
}

.certificate-share-button {
  justify-content: center;
  margin-top: 2px;
  width: 100%;
}

.certificate-share-button.is-loading {
  opacity: 0.72;
}

.total-panel,
.admin-stat {
  background: linear-gradient(135deg, var(--black), var(--rose-dark));
}

.bottom-nav {
  border-color: rgba(224, 24, 98, 0.14);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-strong);
}

.bottom-nav button {
  display: flex;
  min-width: 0;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #5f5661;
  font-size: 11px;
  font-weight: 700;
}

.bottom-nav button .ui-icon {
  width: 17px;
  height: 17px;
}

.bottom-nav button.is-active {
  background: linear-gradient(135deg, var(--black), var(--pink-strong));
  color: #fff;
  box-shadow: 0 10px 22px rgba(224, 24, 98, 0.2);
}

/* Quiet catalog pass: softer surfaces, fewer hard lines. */
.filters {
  gap: 10px;
}

.filter-grid {
  gap: 8px;
}

.search-input,
.filter-menu summary {
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 24px rgba(20, 9, 16, 0.08);
}

.filter-menu summary {
  position: relative;
  min-height: 50px;
  padding-right: 30px;
}

.filter-menu summary::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 2px solid rgba(13, 13, 15, 0.42);
  border-bottom: 2px solid rgba(13, 13, 15, 0.42);
  transform: translateY(-65%) rotate(45deg);
}

.filter-menu[open] summary::after {
  transform: translateY(-35%) rotate(225deg);
}

.filter-options {
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(20, 9, 16, 0.18);
}

.filter-options button {
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  text-align: left;
}

.filter-options button.is-active {
  background: linear-gradient(135deg, rgba(13, 13, 15, 0.95), rgba(217, 54, 114, 0.95));
  color: #fff;
}

.product-grid {
  gap: 14px;
}

.product-card {
  border: 0;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 26px rgba(20, 9, 16, 0.08);
  padding: 10px;
}

.product-card h2 {
  font-size: 15px;
  line-height: 1.22;
}

.product-visual {
  border-radius: 8px;
}

.product-card .badge,
.product-card .badge.pink {
  border: 0;
  background: rgba(217, 54, 114, 0.09);
  color: var(--rose-dark);
}

.product-card-facts {
  overflow: hidden;
}

.product-origin {
  color: rgba(13, 13, 15, 0.54);
}

/* Clean category and search controls. */
.department-tabs {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-flow: initial;
  grid-auto-columns: initial;
  gap: 4px;
  margin: 0 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  padding: 4px;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(20, 9, 16, 0.06);
}

.department-tab,
.department-tab.is-active {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  box-shadow: none;
  color: rgba(13, 13, 15, 0.58);
  min-width: 0;
  padding: 0 6px;
}

.department-tab strong {
  font-size: clamp(10px, 2.9vw, 13px);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.department-tab.is-active {
  background: rgba(13, 13, 15, 0.92);
  color: #fff;
}

.department-gift-tab {
  gap: 5px;
  background: linear-gradient(135deg, var(--black), var(--rose-dark) 56%, var(--pink-strong));
  color: #fff;
  box-shadow: 0 10px 24px rgba(125, 18, 61, 0.22);
}

.department-gift-tab .ui-icon {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
}

.department-gift-tab strong {
  color: inherit;
}

@media (max-width: 430px) {
  .topbar {
    gap: 6px;
  }

  .brand-lockup {
    gap: 8px;
  }

  .brand-lockup strong {
    font-size: 14px;
  }

  .brand-lockup small {
    font-size: 10px;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .cart-pill {
    gap: 5px;
    padding: 0 10px;
  }

  .cart-pill > span {
    display: none;
  }
}

.catalog-head {
  margin: 6px 0 8px;
}

.catalog-head h1::after,
.catalog-head p {
  display: none;
}

.search-filter-row {
  display: flex;
  min-width: 0;
  gap: 8px;
  align-items: stretch;
}

.search-filter-row .search-row {
  flex: 1 1 auto;
  min-width: 0;
}

.search-filter-row .search-input {
  width: 100%;
  min-width: 0;
}

.reset-button {
  display: inline-flex;
  flex: 0 0 auto;
  min-width: 78px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  color: rgba(13, 13, 15, 0.74);
  box-shadow: 0 8px 24px rgba(20, 9, 16, 0.08);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 800;
}

.reset-button .ui-icon {
  width: 17px;
  height: 17px;
}

/* Refined product detail. */
.product-detail {
  gap: 14px;
}

.product-detail .back-button {
  width: max-content;
  min-height: 36px;
  border: 0;
  background: rgba(255, 255, 255, 0.72);
  color: rgba(13, 13, 15, 0.72);
  box-shadow: 0 8px 22px rgba(20, 9, 16, 0.08);
}

.product-detail .section-title {
  margin: 0;
}

.product-detail .muted {
  margin-bottom: 4px;
  color: rgba(13, 13, 15, 0.52);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.product-title {
  max-width: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 26px;
  font-weight: 850;
  line-height: 1.06;
}

.product-detail .badge-row {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.product-detail .badge-row::-webkit-scrollbar {
  display: none;
}

.product-detail .badge {
  flex: 0 0 auto;
  border: 0;
  background: rgba(255, 255, 255, 0.76);
  box-shadow: inset 0 0 0 1px rgba(224, 24, 98, 0.12);
}

.detail-block {
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 12px 28px rgba(20, 9, 16, 0.08);
}

.detail-block-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.detail-block-head .ui-icon {
  width: 17px;
  height: 17px;
  color: var(--pink-strong);
}

.detail-block h2 {
  margin: 0;
  color: rgba(13, 13, 15, 0.58);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.detail-copy p {
  color: rgba(13, 13, 15, 0.72);
  font-size: 14px;
  line-height: 1.5;
}

.variant-grid {
  gap: 6px;
}

.variant-panel .option-button {
  border: 0;
  border-radius: 8px;
  background: rgba(13, 13, 15, 0.04);
  box-shadow: none;
  padding: 10px 12px;
}

.variant-panel .option-button.is-active {
  background: linear-gradient(135deg, var(--black), var(--rose-dark) 58%, var(--pink-strong));
  color: #fff;
  box-shadow: 0 12px 24px rgba(125, 18, 61, 0.22);
}

.variant-panel .option-button.is-active small {
  color: rgba(255, 255, 255, 0.74);
}

.similar-section {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.similar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.similar-head .detail-block-head {
  margin: 0;
}

.similar-head span {
  flex: 0 0 auto;
  color: rgba(13, 13, 15, 0.42);
  font-size: 11px;
  font-weight: 800;
}

.similar-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(154px, 44%);
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}

.similar-rail::-webkit-scrollbar {
  display: none;
}

.similar-card {
  display: grid;
  min-width: 0;
  gap: 8px;
  scroll-snap-align: start;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 28px rgba(20, 9, 16, 0.08);
  padding: 8px;
  text-align: left;
}

.similar-visual {
  aspect-ratio: 1 / 1;
  min-height: 0;
  border-radius: 8px;
}

.similar-visual .product-initials {
  font-size: 16px;
}

.similar-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.similar-copy b,
.similar-copy small,
.similar-copy em,
.similar-copy strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.similar-copy b {
  color: var(--black);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.18;
}

.similar-copy small {
  color: rgba(13, 13, 15, 0.48);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
}

.similar-copy em {
  color: rgba(125, 18, 61, 0.72);
  font-size: 10px;
  font-style: normal;
  font-weight: 750;
}

.similar-copy strong {
  margin-top: 2px;
  color: var(--pink-strong);
  font-size: 12px;
  font-weight: 900;
}

/* Account and loyalty panels. */
.account-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.account-metric {
  display: grid;
  min-height: 92px;
  align-content: space-between;
  gap: 8px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(20, 9, 16, 0.08);
  padding: 12px;
}

.account-metric.is-accent {
  background: linear-gradient(135deg, var(--black), var(--rose-dark) 58%, var(--pink-strong));
  color: #fff;
}

.account-metric span,
.account-metric small,
.account-metric b {
  min-width: 0;
}

.account-metric span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: rgba(13, 13, 15, 0.54);
  font-size: 11px;
  font-weight: 900;
}

.account-metric.is-accent span {
  color: rgba(255, 255, 255, 0.76);
}

.account-metric .ui-icon {
  width: 15px;
  height: 15px;
  color: var(--pink-strong);
}

.account-metric.is-accent .ui-icon {
  color: #fff;
}

.account-metric b {
  overflow: hidden;
  color: var(--black);
  font-size: 24px;
  font-weight: 900;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-metric.is-accent b {
  color: #fff;
}

.account-metric small {
  color: rgba(13, 13, 15, 0.42);
  font-size: 11px;
  font-weight: 750;
}

.account-metric.is-accent small {
  color: rgba(255, 255, 255, 0.68);
}

.account-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 8px;
}

.account-section-head .ui-icon {
  width: 18px;
  height: 18px;
  color: var(--pink-strong);
}

.account-section-head h2 {
  margin: 0;
  color: var(--black);
  font-size: 16px;
}

.account-certificate-block {
  margin-bottom: 10px;
}

.purchase-list,
.loyalty-list {
  display: grid;
  gap: 8px;
}

.purchase-card,
.loyalty-user {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border-radius: 8px;
  background: rgba(13, 13, 15, 0.035);
  padding: 10px;
}

.purchase-card b,
.purchase-card span,
.loyalty-user b,
.loyalty-user span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-card b,
.loyalty-user b {
  color: var(--black);
  font-size: 13px;
  font-weight: 850;
}

.purchase-card span,
.loyalty-user span {
  margin-top: 3px;
  color: rgba(13, 13, 15, 0.48);
  font-size: 11px;
  font-weight: 750;
}

.purchase-card strong {
  color: var(--pink-strong);
  font-size: 13px;
  white-space: nowrap;
}

.loyalty-user {
  grid-template-columns: minmax(0, 1fr);
}

.loyalty-user-main {
  min-width: 0;
}

.loyalty-user-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.loyalty-user-control label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.loyalty-user-control input {
  width: 100%;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  box-shadow: inset 0 0 0 1px rgba(224, 24, 98, 0.16);
  padding: 8px 10px;
}

/* Keyboard-safe input panels. */
.app-shell.is-input-active {
  scroll-padding-top: 14px;
  scroll-padding-bottom: 96px;
}

.app-shell.is-input-active .bottom-nav,
.app-shell.is-input-active .admin-mode-bar {
  pointer-events: none;
  opacity: 0;
  transform: translateY(calc(100% + 22px));
}

.bottom-nav,
.admin-mode-bar {
  transition: opacity 160ms ease, transform 160ms ease;
}

.field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.field label {
  margin: 0;
  color: rgba(13, 13, 15, 0.56);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.2;
}

.field:focus-within label {
  color: var(--rose-dark);
}

.search-input,
.field input,
.field select,
.field textarea,
.ml-control input {
  display: block;
  width: 100%;
  min-width: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--black);
  caret-color: var(--pink-strong);
  line-height: 1.35;
  outline: none;
  box-shadow: 0 8px 24px rgba(20, 9, 16, 0.08), inset 0 0 0 1px rgba(224, 24, 98, 0.11);
  -webkit-user-select: text;
  user-select: text;
}

.search-input,
.field input,
.field select,
.ml-control input {
  min-height: 48px;
  padding: 12px 14px;
}

.search-row .search-input {
  padding-left: 42px;
}

.field textarea {
  min-height: 112px;
  max-height: 190px;
  padding: 12px 14px;
  resize: none;
  overflow: auto;
  white-space: pre-wrap;
}

.search-input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.ml-control input:focus {
  box-shadow: 0 12px 28px rgba(20, 9, 16, 0.1), inset 0 0 0 2px rgba(224, 24, 98, 0.4);
}

.field textarea::placeholder,
.field input::placeholder,
.search-input::placeholder {
  color: rgba(13, 13, 15, 0.38);
}

.checkout-form,
.certificate-form,
.inventory-panel {
  scroll-margin-bottom: 34px;
}

.certificate-form {
  gap: 12px;
}

.certificate-form > .field,
.checkout-form > .field,
.inventory-toolbar .field {
  min-width: 0;
}

@media (max-width: 520px) {
  .certificate-banner {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .certificate-button {
    grid-column: 1 / -1;
  }

  .bottom-nav button {
    flex-direction: column;
  }
}

/* Certificate workflow and compact account/admin states. */
*::selection {
  background: rgba(242, 191, 212, 0.72);
  color: var(--black);
}

*::-moz-selection {
  background: rgba(242, 191, 212, 0.72);
  color: var(--black);
}

p,
h1,
h2,
h3,
span,
b,
small,
em,
label,
input,
textarea,
.detail-copy,
.certificate-card,
.purchase-card,
.admin-order {
  -webkit-user-select: text;
  user-select: text;
}

button,
summary {
  -webkit-user-select: none;
  user-select: none;
}

.department-tabs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.certificate-banner.soft-gift-banner {
  margin-top: 2px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 242, 248, 0.92)) padding-box,
    linear-gradient(135deg, rgba(224, 24, 98, 0.42), rgba(255, 208, 184, 0.8), rgba(11, 11, 13, 0.34)) border-box;
  color: var(--black);
  box-shadow: 0 12px 30px rgba(20, 9, 16, 0.1);
}

.certificate-banner.soft-gift-banner::after {
  background: linear-gradient(110deg, transparent 0 60%, rgba(224, 24, 98, 0.06) 60% 100%);
}

.certificate-banner.soft-gift-banner .certificate-icon {
  background: linear-gradient(135deg, var(--black), var(--pink-strong));
}

.certificate-banner.soft-gift-banner span {
  color: var(--rose-dark);
  letter-spacing: 0;
}

.certificate-banner.soft-gift-banner h1 {
  color: var(--black);
}

.certificate-banner.soft-gift-banner p {
  color: rgba(13, 13, 15, 0.58);
}

.certificate-banner.soft-gift-banner .certificate-button {
  background: linear-gradient(135deg, var(--black), var(--pink-strong));
  color: #fff;
}

.certificate-banner.soft-gift-banner .certificate-button span,
.certificate-banner.soft-gift-banner .certificate-button .ui-icon {
  color: #fff;
}

.certificate-flow {
  display: grid;
  gap: 12px;
}

.certificate-flow > .back-button {
  width: max-content;
}

.certificate-hero {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff, #fff1f7 62%, #ffe0cb);
  box-shadow: 0 14px 34px rgba(20, 9, 16, 0.1);
  padding: 14px;
}

.certificate-hero h1 {
  margin: 2px 0 4px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 24px;
  line-height: 1.05;
}

.certificate-hero span:last-child {
  color: rgba(13, 13, 15, 0.62);
  font-size: 13px;
  line-height: 1.35;
}

.certificate-flow-form,
.certificate-payment-panel,
.certificate-preview-card {
  display: grid;
  gap: 12px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 14px 34px rgba(20, 9, 16, 0.09);
  padding: 12px;
}

.certificate-preview-card img {
  width: 100%;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(20, 9, 16, 0.08);
}

.certificate-preview-card.is-compact img {
  max-height: 420px;
  object-fit: contain;
}

.certificate-action-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.payment-methods {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.payment-methods button {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: rgba(13, 13, 15, 0.05);
  color: var(--black);
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 850;
}

.payment-methods button.is-active {
  background: linear-gradient(135deg, var(--black), var(--pink-strong));
  color: #fff;
  box-shadow: 0 12px 26px rgba(125, 18, 61, 0.2);
}

.payment-instruction p {
  white-space: pre-line;
}

.proof-upload {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  min-height: 58px;
  gap: 12px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff0f6, #fff);
  color: var(--rose-dark);
  box-shadow: inset 0 0 0 1px rgba(224, 24, 98, 0.12);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 850;
  overflow: hidden;
  cursor: pointer;
  user-select: none;
}

.proof-upload.is-ready {
  background: linear-gradient(135deg, #effbf6, #fff);
  color: #0e7c55;
  box-shadow: inset 0 0 0 1px rgba(14, 124, 85, 0.16);
}

.proof-upload.is-busy {
  color: var(--rose-dark);
}

.proof-upload-icon {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--black), var(--pink-strong));
  color: #fff;
  box-shadow: 0 10px 22px rgba(125, 18, 61, 0.18);
}

.proof-upload.is-ready .proof-upload-icon {
  background: #0e7c55;
  box-shadow: 0 10px 22px rgba(14, 124, 85, 0.14);
}

.proof-upload-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.proof-upload-copy b,
.proof-upload-copy small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proof-upload-copy b {
  color: inherit;
  font-size: 14px;
  line-height: 1.15;
}

.proof-upload-copy small {
  color: rgba(13, 13, 15, 0.54);
  font-size: 12px;
  font-weight: 750;
}

.proof-upload.is-ready .proof-upload-copy small {
  color: rgba(14, 124, 85, 0.72);
}

.proof-upload > :not(input) {
  pointer-events: none;
}

.proof-upload span:not(.proof-upload-copy):not(.proof-upload-icon) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proof-native-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 2;
}

.certificate-forming-status {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 9px;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff0f6, #fff);
  color: var(--rose-dark);
  box-shadow: inset 0 0 0 1px rgba(224, 24, 98, 0.12);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
}

.certificate-forming-status > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.certificate-forming-status b,
.certificate-forming-status small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.certificate-forming-status small {
  color: rgba(13, 13, 15, 0.54);
  font-size: 12px;
  font-weight: 750;
}

.proof-status {
  display: flex;
  min-height: 36px;
  align-items: center;
  border-radius: 8px;
  background: rgba(13, 13, 15, 0.045);
  color: rgba(13, 13, 15, 0.58);
  padding: 0 11px;
  font-size: 12px;
  font-weight: 850;
}

.proof-status.is-ready {
  background: linear-gradient(135deg, #effbf6, #fff);
  color: #0e7c55;
}

.certificate-mini-image {
  width: 100%;
  max-width: 320px;
  margin: 12px auto 0;
  border-radius: 8px;
}

.account-accordion {
  margin-bottom: 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 28px rgba(20, 9, 16, 0.08);
  overflow: hidden;
}

.account-accordion > summary,
.purchase-card > summary,
.certificate-card-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  padding: 12px;
  cursor: pointer;
  list-style: none;
}

.account-accordion > summary::-webkit-details-marker,
.purchase-card > summary::-webkit-details-marker,
.certificate-card > summary::-webkit-details-marker {
  display: none;
}

.account-accordion > summary span,
.account-accordion > summary b {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.account-accordion > summary b {
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 999px;
  background: #fff0f6;
  color: var(--rose-dark);
  font-size: 12px;
}

.certificate-list,
.purchase-list {
  padding: 0 10px 10px;
}

.certificate-card,
.purchase-card {
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(13, 13, 15, 0.035);
  box-shadow: none;
  overflow: hidden;
}

.certificate-card + .certificate-card,
.purchase-card + .purchase-card {
  margin-top: 8px;
}

.certificate-card-summary {
  grid-template-columns: minmax(84px, auto) minmax(0, 1fr) auto auto;
  min-height: 46px;
}

.certificate-card-summary b,
.certificate-card-summary span,
.certificate-card-summary em,
.certificate-card-summary small,
.purchase-card summary b,
.purchase-card summary em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.certificate-card-summary b {
  color: var(--pink-strong);
  font-size: 13px;
}

.certificate-card-summary span,
.certificate-card-summary em,
.purchase-card summary em {
  color: rgba(13, 13, 15, 0.5);
  font-size: 11px;
  font-style: normal;
  font-weight: 750;
}

.certificate-card-summary small {
  border-radius: 999px;
  background: #fff;
  color: var(--rose-dark);
  padding: 7px 9px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.certificate-card-main,
.purchase-items {
  padding: 0 12px 12px;
}

.purchase-card {
  display: block;
}

.purchase-card > summary {
  grid-template-columns: minmax(0, 1fr) auto;
}

.purchase-card strong {
  color: var(--pink-strong);
  font-size: 13px;
}

.purchase-items {
  display: grid;
  gap: 5px;
}

.purchase-items p {
  margin: 0;
  color: rgba(13, 13, 15, 0.62);
  font-size: 12px;
}

.admin-settings-form,
.payment-settings-list,
.admin-manager {
  display: grid;
  gap: 10px;
}

.admin-settings-form {
  margin-top: 12px;
}

.payment-setting {
  display: grid;
  gap: 8px;
  border-radius: 8px;
  background: rgba(13, 13, 15, 0.035);
  padding: 10px;
}

.payment-setting input,
.payment-setting textarea,
.certificate-admin-review input {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--black);
  box-shadow: inset 0 0 0 1px rgba(224, 24, 98, 0.12);
  padding: 10px 12px;
}

.payment-setting textarea {
  min-height: 82px;
  resize: vertical;
}

.admin-manager {
  border-radius: 8px;
  background: linear-gradient(135deg, #fff8fb, #fff);
  box-shadow: inset 0 0 0 1px rgba(224, 24, 98, 0.12);
  padding: 12px;
}

.admin-manager h3 {
  margin: 0;
  font-size: 15px;
}

.certificate-admin-card {
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
}

.certificate-admin-thumb {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
}

.certificate-admin-card small {
  display: block;
  margin-top: 3px;
  color: rgba(13, 13, 15, 0.44);
  font-size: 11px;
}

.certificate-admin-review {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.proof-open-button {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff0f6, #fff);
  color: var(--black);
  padding: 6px 10px 6px 6px;
  text-align: left;
  box-shadow: inset 0 0 0 1px rgba(224, 24, 98, 0.12);
}

.proof-open-button img,
.proof-open-button > .ui-icon {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
}

.proof-open-button > .ui-icon {
  padding: 12px;
  color: var(--pink-strong);
}

.proof-open-button span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.proof-open-button b,
.proof-open-button small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.proof-open-button b {
  color: var(--black);
  font-size: 13px;
}

.proof-open-button small,
.proof-empty {
  color: rgba(13, 13, 15, 0.48);
  font-size: 11px;
  font-weight: 800;
}

.toast-slot {
  position: fixed;
  right: 14px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  left: 14px;
  z-index: 80;
  max-width: 820px;
  margin: 0 auto;
  pointer-events: none;
}

.app-shell.has-admin-switch .toast-slot {
  bottom: calc(164px + env(safe-area-inset-bottom));
}

.app-toast {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  border-radius: 8px;
  background: rgba(13, 13, 15, 0.94);
  color: #fff;
  box-shadow: 0 18px 44px rgba(20, 9, 16, 0.24);
  padding: 8px 10px 8px 14px;
  pointer-events: auto;
}

.app-toast span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 850;
}

.app-toast button {
  min-height: 32px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--rose-dark);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 900;
}

.app-toast .toast-close {
  width: 32px;
  padding: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 18px;
}

.qr-denied-state .heart-cloud {
  margin: 12px 0;
  color: var(--pink-strong);
  font-size: 28px;
  letter-spacing: 6px;
}

@media (max-width: 520px) {
  .payment-methods,
  .certificate-action-row,
  .certificate-admin-review {
    grid-template-columns: 1fr;
  }

  .certificate-admin-card {
    grid-template-columns: 62px minmax(0, 1fr);
  }

  .certificate-admin-card > div:nth-of-type(2) {
    grid-column: 2;
  }
}

/* Final polish: cart, delivery, users, QR preview, and image stability. */
.product-visual,
.certificate-preview-card img,
.certificate-admin-thumb,
.cart-item {
  contain: layout paint;
}

.product-visual img {
  content-visibility: auto;
}

.refined-cart-item {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #fff, #fff7fb);
  box-shadow: 0 12px 30px rgba(20, 9, 16, 0.08);
  padding: 12px;
}

.cart-item-copy {
  min-width: 0;
}

.cart-item-copy h2 {
  font-size: 15px;
  line-height: 1.2;
}

.cart-item-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.delivery-choice {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.delivery-card {
  display: grid;
  min-height: 72px;
  gap: 4px;
  border: 1px solid rgba(224, 24, 98, 0.14);
  border-radius: 12px;
  background: #fff;
  color: var(--black);
  padding: 11px;
  text-align: left;
}

.delivery-card b,
.delivery-card span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.delivery-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.delivery-card.is-active {
  border-color: transparent;
  background: linear-gradient(135deg, var(--black), var(--pink-strong));
  color: #fff;
}

.delivery-card.is-active span {
  color: rgba(255, 255, 255, 0.76);
}

.purchase-total {
  border-radius: 999px;
  background: #fff0f6;
  color: var(--rose-dark);
  padding: 9px 12px;
  font-size: 13px;
}

.certificate-qr-button {
  display: grid;
  width: min(190px, 70%);
  margin: 10px auto 0;
  border: 0;
  border-radius: 14px;
  background: #fff;
  padding: 10px;
  box-shadow: inset 0 0 0 1px rgba(224, 24, 98, 0.14);
}

.certificate-qr {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.qr-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  gap: 14px;
  background: rgba(9, 9, 11, 0.86);
  padding: 28px;
}

.qr-lightbox img {
  width: min(82vw, 420px);
  aspect-ratio: 1;
  border-radius: 18px;
  background: #fff;
  padding: 18px;
}

.qr-lightbox span {
  color: #fff;
  font-weight: 850;
}

.qr-lightbox-close {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--rose-dark);
  font-size: 24px;
}

.user-list-card {
  width: 100%;
  border: 0;
  text-align: left;
}

.user-list-card strong {
  color: var(--pink-strong);
  font-size: 12px;
  white-space: nowrap;
}

.user-profile {
  gap: 12px;
}

.danger-soft {
  border-color: rgba(148, 24, 66, 0.18);
  color: #941842;
}

.checkout-payable-card {
  display: grid;
  gap: 5px;
  border-radius: 18px;
  background: linear-gradient(135deg, var(--black), var(--rose-dark) 58%, var(--pink-strong));
  color: #fff;
  padding: 16px;
  box-shadow: 0 14px 28px rgba(125, 18, 61, 0.2);
}

.checkout-payable-card span,
.checkout-payable-card small {
  color: rgba(255, 255, 255, 0.76);
  font-size: 12px;
  font-weight: 750;
}

.checkout-payable-card b {
  font-size: 24px;
  line-height: 1.1;
}

.currency-rate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.currency-rate-grid label {
  display: grid;
  gap: 5px;
}

.currency-rate-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.currency-rate-grid input {
  width: 100%;
  border: 1px solid rgba(224, 24, 98, 0.16);
  border-radius: 10px;
  background: #fff;
  padding: 10px;
}

.admin-scanner {
  display: grid;
  gap: 12px;
}

.admin-scanner-actions,
.admin-scanner-manual,
.certificate-admin-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.admin-scanner-actions {
  flex-wrap: wrap;
}

.admin-scanner-manual input {
  min-width: 0;
  flex: 1;
  height: 46px;
  border: 1px solid rgba(224, 24, 98, 0.18);
  border-radius: 12px;
  background: #fff;
  padding: 0 12px;
  font-size: 14px;
}

.admin-scanner-camera {
  display: none;
  position: relative;
  overflow: hidden;
  min-height: 240px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(10, 10, 12, 0.92), rgba(125, 18, 61, 0.84)),
    #0b0b0d;
}

.admin-scanner-camera.is-active {
  display: block;
}

.admin-scanner-camera video {
  width: 100%;
  height: 280px;
  object-fit: cover;
}

.admin-scanner-camera span {
  position: absolute;
  right: 12px;
  bottom: 12px;
  left: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--rose-dark);
  padding: 10px 12px;
  text-align: center;
  font-size: 13px;
  font-weight: 800;
}

.certificate-admin-head {
  justify-content: space-between;
  margin-bottom: 10px;
}

.certificate-admin-head h2 {
  margin: 0;
}

.certificate-admin-card.is-highlighted,
.certificate-admin-card-scanned {
  border-color: transparent;
  background:
    linear-gradient(#fff, #fff) padding-box,
    linear-gradient(135deg, var(--black), var(--pink-strong), var(--peach)) border-box;
  box-shadow: 0 16px 34px rgba(224, 24, 98, 0.18);
}

.bottom-nav button span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

@media (max-width: 520px) {
  .delivery-choice {
    grid-template-columns: 1fr;
  }

  .cart-item {
    grid-template-columns: 1fr;
  }

  .cart-item-actions {
    justify-items: stretch;
  }
}
