:root {
  --ui-primary: #6d5bd0;
  --ui-primary-700: #5b21b6;
  --ui-primary-soft: #ede9fe;
  --ui-primary-border: #c4b5fd;
  --ui-success: #22c55e;
  --ui-ink: #0f172a;
  --ui-muted: #64748b;
  --ui-line: #e2e8f0;
  --ui-bg: #f8fafc;
  --ui-card: #ffffff;
  --ui-danger: #b91c1c;
  --ui-page-inline: 1rem;
  --ui-first-section-gap: 0.75rem;
  --ui-section-gap: 1rem;
}

html, body {
  font-family: "Manrope", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.app-shell-bg {
  background:
    radial-gradient(1000px 380px at 5% -10%, rgba(109, 91, 208, 0.10), transparent 62%),
    radial-gradient(1100px 420px at 95% -14%, rgba(15, 23, 42, 0.04), transparent 65%),
    linear-gradient(180deg, #fbfcfe, var(--ui-bg));
  color: var(--ui-ink);
}

.ui-card {
  border: 1px solid var(--ui-line);
  background: var(--ui-card);
  border-radius: 1rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.ui-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.25rem 0.625rem;
  font-size: 11px;
  font-weight: 700;
}

.ui-chip-muted {
  background: #f1f5f9;
  color: #475569;
}

.ui-chip-primary-soft {
  background: var(--ui-primary-soft);
  color: var(--ui-primary-700);
}

.ui-store-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  max-width: 100%;
  padding: 0.36rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(226, 232, 240, 0.92);
  background: rgba(248, 250, 252, 0.88);
}

.ui-store-chip-avatar {
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, rgba(109, 91, 208, 0.18), rgba(124, 58, 237, 0.24));
  color: var(--ui-primary-700);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.ui-store-chip-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ui-store-chip-meta {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  line-height: 1;
}

.ui-store-chip-status {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.ui-store-chip-status.is-success {
  color: #15803d;
}

.ui-store-chip-status.is-warning {
  color: #b45309;
}

.ui-store-chip-status.is-danger {
  color: #b91c1c;
}

.ui-store-chip-status.is-muted {
  color: #64748b;
}

.ui-store-chip-status::before {
  content: "";
  width: 0.38rem;
  height: 0.38rem;
  border-radius: 999px;
}

.ui-store-chip-status.is-success::before {
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.ui-store-chip-status.is-warning::before {
  background: #f59e0b;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.ui-store-chip-status.is-danger::before {
  background: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.14);
}

.ui-store-chip-status.is-muted::before {
  background: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.14);
}

.ui-page-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.ui-page-header-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.ui-page-header-title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ui-ink);
}

.ui-page-header-title-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.65rem;
  min-width: 0;
}

.ui-page-header-meta {
  margin-top: 0.35rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.75rem;
  min-width: 0;
}

.ui-page-header-connected {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  min-width: 0;
  max-width: 100%;
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}

.ui-page-header-connected.is-success {
  color: #047857;
}

.ui-page-header-connected.is-warning {
  color: #b45309;
}

.ui-page-header-connected.is-danger {
  color: #b91c1c;
}

.ui-page-header-connected.is-muted {
  color: #64748b;
}

.ui-page-header-connected::before {
  content: "";
  width: 0.34rem;
  height: 0.34rem;
  border-radius: 999px;
  flex-shrink: 0;
}

.ui-page-header-connected.is-success::before {
  background: #22c55e;
}

.ui-page-header-connected.is-warning::before {
  background: #f59e0b;
}

.ui-page-header-connected.is-danger::before {
  background: #ef4444;
}

.ui-page-header-connected.is-muted::before {
  background: #94a3b8;
}

.ui-page-header-secondary {
  font-size: 11px;
  font-weight: 600;
}

.ui-page-header-secondary.is-muted {
  color: #64748b;
}

.ui-page-header-secondary.is-success {
  color: #047857;
}

.ui-page-header-secondary.is-danger {
  color: #b91c1c;
}

.ui-page-header-secondary.is-primary {
  color: var(--ui-primary-700);
}

.ui-page-header-inline-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.ui-page-header-inline-status svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.ui-page-header-inline-status.is-muted {
  color: #64748b;
}

.ui-page-header-inline-status.is-success {
  color: #047857;
}

.ui-page-header-inline-status.is-danger {
  color: #b91c1c;
}

.ui-page-header-inline-status.is-primary {
  color: var(--ui-primary-700);
}

.ui-access-blocked-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: var(--ui-bg);
  color: var(--ui-ink);
}

.ui-access-blocked-panel {
  width: min(380px, 100%);
  display: grid;
  gap: 14px;
  justify-items: center;
  text-align: center;
}

.ui-access-blocked-brand {
  height: 28px;
  width: auto;
}

.ui-access-blocked-mascot {
  width: 92px;
  height: 92px;
  object-fit: contain;
}

.ui-access-blocked-title {
  margin: 0;
  color: var(--ui-ink);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: 0;
}

.ui-access-blocked-copy {
  margin: 0;
  color: var(--ui-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
}

.ui-access-blocked-action {
  margin-top: 4px;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  background: var(--ui-primary);
  color: #fff;
  padding: 12px 18px;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
}

.ui-page-main {
  padding-inline: var(--ui-page-inline);
  padding-top: var(--ui-first-section-gap);
}

.ui-page-stack {
  display: flex;
  flex-direction: column;
  gap: var(--ui-section-gap);
}

.ui-section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.ui-section-header-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.ui-section-title {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--ui-ink);
}

.ui-section-description {
  margin-top: 0.25rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #64748b;
}

.ui-product-row {
  padding-block: 0.75rem;
}

.ui-product-row-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.ui-product-thumb {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  overflow: hidden;
  flex-shrink: 0;
  border: 1px solid var(--ui-line);
  background: #f3f4f6;
}

.ui-product-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ui-product-thumb-empty {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 500;
  color: #94a3b8;
}

.ui-product-row-copy {
  min-width: 0;
  flex: 1 1 auto;
}

.ui-product-row-title {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ui-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-product-row-price {
  margin-top: 0.125rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #475569;
}

.ui-product-row-meta {
  margin-top: 0.125rem;
  font-size: 11px;
  line-height: 1.35;
  color: #64748b;
}

.ui-product-row-breakdown {
  margin-top: 0.25rem;
  padding-left: 3.25rem;
}

.ui-product-row-breakdown-list {
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.ui-product-row-breakdown-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.ui-product-row-breakdown-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
  color: #64748b;
}

.ui-product-row-breakdown-price {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 11px;
  color: #0f172a;
}

.ui-btn-primary {
  border-radius: 0.75rem;
  background: var(--ui-primary);
  color: #fff;
  font-weight: 700;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease;
}

.ui-btn-primary:hover {
  box-shadow: 0 8px 20px rgba(109, 91, 208, 0.22);
}

.ui-btn-primary:active {
  transform: translateY(1px);
}

.ui-btn-secondary {
  border-radius: 0.75rem;
  border: 1px solid var(--ui-line);
  background: #fff;
  color: #334155;
  font-weight: 700;
  transition: border-color .2s ease, background-color .2s ease;
}

.ui-btn-secondary:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.ui-btn-primary:disabled,
.ui-btn-secondary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ui-segment {
  border: 1px solid var(--ui-line);
  border-radius: 0.75rem;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
}

.ui-segment-btn {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  background: #fff;
  padding: 0.35rem 0.7rem;
  border: 0;
}

.ui-segment-btn.active {
  background: var(--ui-primary-soft);
  color: var(--ui-primary-700);
}

.ui-segment-sep {
  width: 1px;
  align-self: stretch;
  background: var(--ui-line);
}

.ui-switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  display: inline-block;
  vertical-align: top;
  flex-shrink: 0;
  width: 46px;
  height: 28px;
  padding: 0;
  border-radius: 999px;
  background: #cbd5e1;
  border: 1px solid #cbd5e1;
  overflow: hidden;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.ui-switch::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
  transition: transform .2s ease, box-shadow .2s ease;
}

.ui-switch.on {
  background: var(--ui-primary);
  border-color: var(--ui-primary);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}

.ui-switch.on::after {
  transform: translateX(18px);
}

.ui-switch:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(109, 91, 208, 0.12);
}

.ui-loading {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .65rem;
  color: #64748b;
  font-size: .82rem;
}

.ui-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--ui-primary);
  border-top-color: transparent;
  border-radius: 999px;
  animation: ui-spin .9s linear infinite;
}

.ui-spin {
  animation: ui-spin .9s linear infinite;
  transform-origin: center;
}

@keyframes ui-spin {
  to { transform: rotate(360deg); }
}

.ui-info-btn {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  color: #475569;
  font-size: 11px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  line-height: 1;
  transition: border-color .2s ease, background-color .2s ease;
}

.ui-info-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.ui-hint {
  display: none;
  margin-top: 0.45rem;
  border: 1px solid #ddd6fe;
  background: #f5f3ff;
  color: #4c1d95;
  border-radius: 0.65rem;
  padding: 0.5rem 0.65rem;
  font-size: 11px;
  line-height: 1.35;
}

.ui-hint.open {
  display: block;
}

.ui-checkbox {
  width: 1rem;
  height: 1rem;
  accent-color: var(--ui-primary);
}

.ui-control {
  width: 100%;
  height: 2.45rem;
  border-radius: 0.7rem;
  border: 1px solid #dbe1ea;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
  padding: 0 .72rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.ui-control:hover {
  border-color: #c5ceda;
}

.ui-control:focus {
  border-color: var(--ui-primary-border);
  box-shadow: 0 0 0 3px rgba(109, 91, 208, 0.12);
}

select.ui-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2rem;
  background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: calc(100% - 17px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.ui-control-compact {
  border-radius: 0.7rem;
  border: 1px solid #dbe1ea;
  background: #fff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
  padding: 0 .65rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.ui-control-compact:hover {
  border-color: #c5ceda;
}

.ui-control-compact:focus {
  border-color: var(--ui-primary-border);
  box-shadow: 0 0 0 3px rgba(109, 91, 208, 0.12);
}

select.ui-control-compact {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 1.85rem;
  background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: calc(100% - 16px) calc(50% - 2px), calc(100% - 11px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.ui-premium-controls input[type="text"],
.ui-premium-controls input[type="number"],
.ui-premium-controls input[type="search"],
.ui-premium-controls select {
  border-radius: 0.7rem;
  border: 1px solid #dbe1ea;
  background-color: #fff;
  color: #0f172a;
  font-size: 12px;
  font-weight: 600;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}

.ui-premium-controls input[type="text"]:hover,
.ui-premium-controls input[type="number"]:hover,
.ui-premium-controls input[type="search"]:hover,
.ui-premium-controls select:hover {
  border-color: #c5ceda;
}

.ui-premium-controls input[type="text"]:focus,
.ui-premium-controls input[type="number"]:focus,
.ui-premium-controls input[type="search"]:focus,
.ui-premium-controls select:focus {
  border-color: var(--ui-primary-border);
  box-shadow: 0 0 0 3px rgba(109, 91, 208, 0.12);
}

.ui-premium-controls select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #64748b 50%), linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position: calc(100% - 17px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.ui-field {
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  background: linear-gradient(180deg, #ffffff, #fbfcff);
  padding: 0.62rem;
}

.ui-field-title {
  font-size: 11px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 0.4rem;
}
