:root {
  --bg: #d9d0d8;
  --bg-2: #cdbfc9;
  --panel: rgba(255, 255, 255, 0.72);
  --text: #232129;
  --muted: #5f5a65;
  --brand: #844f74;
  --line: rgba(255, 255, 255, 0.52);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: 'Inter', Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 8%, rgba(255, 255, 255, 0.35), transparent 40%),
    linear-gradient(165deg, var(--bg), var(--bg-2));
}

.app-shell {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 10px 12px 108px;
}

.tab-panel,
.bottom-tabs,
.hero-card,
.product-card,
.deal-item,
.support-card,
.quick-counters article {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.brand-card { border-radius: 14px; border: 1px solid var(--line); padding: 10px; background: rgba(225, 216, 224, 0.62); }
.brand-frame { border: 4px solid #c8c2c9; min-height: 78px; display: grid; place-content: center; text-align: center; }
.brand-frame h1 { margin: 0; font-family: Georgia, 'Times New Roman', serif; letter-spacing: 0.06em; font-size: 1.45rem; }
.brand-frame p { margin: 0; font-size: 0.82rem; }

main { margin-top: 10px; }
.tab-panel { display: none; border: 1px solid var(--line); background: var(--panel); border-radius: 14px; padding: 12px; }
.tab-panel.is-active { display: block; }
h1, h2 { margin: 0 0 6px; font-size: 1.2rem; }
h3 { margin: 0 0 6px; font-size: 1rem; }
.muted { margin: 0; color: var(--muted); font-size: 0.85rem; }

.quick-counters { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; margin: 10px 0; }
.quick-counters article { border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,0.63); padding: 7px; }
.quick-counters strong { display: block; font-size: 0.9rem; }
.quick-counters small { color: var(--muted); font-size: 0.73rem; }

.hero-card { border: 1px solid var(--line); background: rgba(255,255,255,0.68); border-radius: 12px; padding: 10px; }
.hero-image-wrap {
  margin: -2px -2px 10px;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  max-height: 360px;
}
.hero-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  border-radius: inherit;
}
.hero-card h3 { font-size: 1.2rem; margin-bottom: 8px; }
.hero-card p { margin: 0 0 10px; font-size: 0.9rem; line-height: 1.35; }

.catalog-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.ghost-chip { border: 1px solid #d4cad2; background: rgba(255,255,255,.82); border-radius: 999px; padding: 4px 10px; font-size: .73rem; white-space: nowrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.chip { border: 1px solid #d2c8d1; background: rgba(255,255,255,0.7); border-radius: 999px; padding: 4px 10px; font-size: 0.74rem; }
.chip.is-active { background: #242429; color: #fff; }

.cards-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 8px; }
.product-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.84);
  padding: 7px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
}
.product-cover {
  border-radius: 10px;
  background: linear-gradient(160deg, #d9c8d7 0%, #c7afbe 100%);
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
}
.product-cover-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: inherit;
}
.product-cover-large { max-width: 520px; margin: 0 auto; }
 .cashback-badge {
  position: absolute;
  right: 6px;
  top: 6px;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: .7rem;
  font-weight: 800;
  color: #fff;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
}

.marketplace-badge {
  position: absolute;
  left: 6px;
  bottom: 6px;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: .66rem;
  font-weight: 700;
  color: #fff;
}

.marketplace-badge--ozon {
  background: #fff;
  color: #005bff;
  border: 1px solid rgba(0,0,0,.08);
}

.marketplace-badge--wb {
  background: #D5008F; /* Pantone 2395C (web approximation) */
  color: #fff;
}

.product-title {
  margin: 7px 0 4px;
  font-size: 0.82rem;
  line-height: 1.14;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.old-price { margin: 0; font-size: 0.68rem; color: #7a7080; text-decoration: line-through; }
.new-price { margin: 0; font-size: 0.87rem; font-weight: 800; }

.meta-row {
  margin: 3px 0 4px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}

.payout-line { margin: 0; font-size: 0.66rem; color: #554a58; }
.stock-line { margin: 0; font-size: 0.66rem; font-weight: 700; color: #5b4f5c; }
.progress { height: 5px; border-radius: 999px; background: rgba(143,115,139,.2); overflow: hidden; margin-bottom: 4px; }
.progress-bar { height: 100%; background: linear-gradient(90deg,#ca7b6d,#b7555f); }

.primary-btn {
  border: 1px solid #8c4e79;
  background: linear-gradient(160deg,#a3488b,#7d396c);
  color: #fff;
  border-radius: 9px;
  padding: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  width: 100%;
}

.history-filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.filter-chip { border: 1px solid #d2c8d1; background: #fff; border-radius: 999px; padding: 4px 10px; font-size: 0.74rem; }
.filter-chip.is-active { background: var(--brand); color: #fff; }
.deal-list { display: grid; gap: 8px; }
.deal-item { border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,0.72); padding: 9px; display: flex; justify-content: space-between; gap: 8px; }
.deal-item h3 { margin: 0 0 4px; font-size: 0.88rem; }
.deal-item p { margin: 0; font-size: 0.74rem; color: #645c68; }
.status { display: inline-block; margin-bottom: 4px; padding: 2px 6px; border-radius: 999px; background: rgba(132, 79, 116, .12); color: #663f5f; font-size: 0.68rem; }
.deal-item strong { display: block; font-size: 0.86rem; text-align: right; }

.support-card { border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,0.72); padding: 10px; margin-bottom: 10px; }
.support-card ol { margin: 0; padding-left: 18px; }
.support-card li { margin-bottom: 6px; font-size: 0.84rem; }
.support-card p { margin: 0 0 10px; font-size: 0.86rem; }

.support-link {
  color: var(--brand);
  font-weight: 700;
  text-decoration: none;
}

.support-link:hover {
  text-decoration: underline;
}

.bottom-tabs {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 10px;
  width: min(396px, calc(100vw - 18px));
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
  gap: 6px;
  padding: 10px 8px 12px;
  border: 1px solid rgba(203, 188, 203, 0.88);
  border-radius: 24px;
  background: rgba(248, 244, 249, 0.95);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: 0 14px 34px rgba(53, 40, 57, 0.18);
}

.tab-btn {
  border: 0;
  background: transparent;
  color: #66616b;
  display: grid;
  justify-items: center;
  gap: 3px;
  font-size: 0.7rem;
  padding: 4px;
  border-radius: 14px;
}

.tab-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(187,174,186,.82);
}

.tab-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.tab-btn.is-active { color: var(--brand); font-weight: 700; }
.tab-btn.is-active .tab-icon {
  background: rgba(132,79,116,.18);
  border-color: rgba(132,79,116,.58);
}

.tab-btn.is-active {
  background: rgba(132,79,116,.08);
}

.admin-entry {
  margin-top: 10px;
  border: 1px solid rgba(132,79,116,.35);
  border-radius: 12px;
  background: rgba(255,255,255,0.72);
  padding: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.admin-entry strong {
  display: block;
  font-size: .86rem;
}

.admin-entry p {
  margin: 4px 0 0;
  font-size: .75rem;
  color: #5d5463;
}

.secondary-btn {
  border: 1px solid #8c4e79;
  background: rgba(132,79,116,.12);
  color: #6e3e62;
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 0.77rem;
  font-weight: 700;
  white-space: nowrap;
}

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

.admin-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

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

.admin-form label {
  font-size: .8rem;
  font-weight: 600;
}

.inline-inputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.inline-inputs input {
  border: 1px solid #d5ccd6;
  border-radius: 9px;
  padding: 9px 10px;
  font: inherit;
}

.primary-btn.compact {
  padding: 7px 9px;
  font-size: .76rem;
}

.small {
  font-size: .75rem;
}

.moderators-list {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.moderator-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255,255,255,0.65);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.moderator-item strong {
  font-size: .82rem;
}

.admin-products-list {
  margin-top: 8px;
  display: grid;
  gap: 8px;
}

.admin-product-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px;
  background: rgba(255,255,255,0.7);
}

.admin-product-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.admin-switch {
  font-size: .74rem;
  color: #5d5463;
}

.admin-offer-grid {
  margin-top: 7px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 6px;
}

.admin-offer-grid label {
  font-size: .68rem;
  color: #5d5463;
  display: grid;
  gap: 4px;
}

.admin-offer-grid input {
  width: 100%;
  border: 1px solid #d5ccd6;
  border-radius: 8px;
  padding: 6px 7px;
  font: inherit;
  font-size: .76rem;
}

.admin-product-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}



.admin-editor-shell {
  border: 1px solid rgba(132,79,116,.24);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,0.78);
  display: grid;
  gap: 10px;
}

.admin-editor-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.admin-editor-switcher .ghost-chip {
  text-align: center;
  padding: 7px 10px;
  font-size: .78rem;
}

.admin-editor-switcher .ghost-chip.is-active {
  background: rgba(132,79,116,.14);
  border-color: rgba(132,79,116,.55);
  color: #6a3f61;
  font-weight: 700;
}

.admin-editor-picker {
  display: grid;
  gap: 6px;
}

.admin-editor-picker label {
  font-size: .74rem;
  color: #5d5463;
  font-weight: 600;
}

.admin-editor-picker select {
  width: 100%;
  border: 1px solid #d5ccd6;
  border-radius: 9px;
  padding: 8px 10px;
  font: inherit;
  font-size: .78rem;
  background: #fff;
}

.admin-editor-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px;
  background: rgba(255,255,255,0.92);
  display: grid;
  gap: 10px;
}

.admin-editor-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.admin-editor-top h4 {
  margin: 0;
  font-size: .86rem;
}

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

.admin-editor-grid label {
  font-size: .7rem;
  color: #5d5463;
  display: grid;
  gap: 4px;
}

.admin-editor-grid input,
.admin-editor-grid select {
  width: 100%;
  border: 1px solid #d5ccd6;
  border-radius: 8px;
  padding: 7px 8px;
  font: inherit;
  font-size: .78rem;
  background: #fff;
}

.admin-editor-actions {
  display: grid;
}

.admin-editor-actions .primary-btn {
  min-height: 42px;
}

.admin-deals-filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }


.admin-deals-filters select,
.admin-deals-filters input {
  min-width: 0;
  border: 1px solid #d5ccd6;
  border-radius: 8px;
  padding: 6px 8px;
  font: inherit;
  font-size: .74rem;
}

.admin-deals-filters .ghost-chip {
  grid-column: 1 / -1;
  justify-self: start;
}

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

.admin-deal-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: rgba(255,255,255,0.68);
  display: grid;
  gap: 7px;
}

.admin-deal-actions {
  display: flex;
  gap: 6px;
}

.product-card {
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}

.product-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(45, 33, 47, .1);
}

.product-details-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.86);
  padding: 12px;
  min-height: clamp(460px, calc(100vh - 260px), 640px);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-cover-large {
  width: 100%;
  max-width: 100%;
  min-height: 300px;
  flex: 1 1 auto;
  margin-bottom: 4px;
}

.product-details-card .primary-btn {
  margin-top: auto;
  min-height: 44px;
  font-size: .88rem;
}

.wizard-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}

.wizard-nav .ghost-chip,
.wizard-nav .primary-btn {
  width: auto;
  flex: 1 1 0;
  min-height: 42px;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

/* when the middle button is hidden, keep Back on the left and Continue on the right */
.wizard-nav .primary-btn {
  margin-left: auto;
}

.wizard-nav .ghost-chip,
.wizard-nav .primary-btn {
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  padding: 9px 10px;
  font-size: 0.82rem;
  font-weight: 700;
}

.wizard-rules {
  margin: 0 0 10px;
  padding-left: 18px;
  font-size: .86rem;
}

.wizard-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
  font-size: .86rem;
}

.wizard-input {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  font-size: .84rem;
  font-weight: 600;
}

.wizard-input input {
  border: 1px solid #d5ccd6;
  border-radius: 9px;
  padding: 9px 10px;
  font: inherit;
}

.wizard-file-picker {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
  border: 1px dashed #d1c5d1;
  border-radius: 10px;
  padding: 10px;
  background: #f8f6f8;
  cursor: pointer;
}

.wizard-file-picker input {
  display: none;
}

.wizard-file-picker small {
  color: #615963;
  font-size: .78rem;
}

.wizard-file-placeholder {
  display: grid;
  place-items: center;
  min-height: 86px;
  border-radius: 8px;
  background: rgba(209,197,209,.35);
  color: #615963;
  font-size: .8rem;
}

.wizard-file-preview {
  width: 100%;
  max-height: 180px;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid #e2d8e2;
  background: #fff;
}


.wizard-example,
.wizard-summary,
.wizard-cta-box {
  border: 1px solid #e2d8e2;
  background: #faf8fa;
  border-radius: 8px;
  padding: 9px;
  margin-bottom: 10px;
}

.wizard-success {
  text-align: left;
}

.ui-toast {
  position: fixed;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  bottom: 92px;
  z-index: 50;
  min-width: min(360px, calc(100vw - 24px));
  max-width: min(380px, calc(100vw - 20px));
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(132,79,116,.35);
  background: rgba(37, 32, 39, .94);
  color: #fff;
  font-size: .82rem;
  line-height: 1.35;
  box-shadow: 0 14px 26px rgba(32, 22, 32, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.ui-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}


.editor-file-picker {
  display: grid !important;
  gap: 6px;
  border: 1px dashed #d1c5d1;
  border-radius: 10px;
  padding: 8px;
  background: #f8f6f8;
  cursor: pointer;
}

.editor-file-picker input[type="file"] {
  display: none;
}

.editor-file-placeholder {
  min-height: 58px;
  border: 1px solid #e2d8e2;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: #615963;
  font-size: .78rem;
  background: #fff;
  overflow: hidden;
}


/* Hide number input arrows (spinners) */
.no-spin::-webkit-outer-spin-button,
.no-spin::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.no-spin[type=number] {
  -moz-appearance: textfield;
}

.wizard-input input[type=number]::-webkit-outer-spin-button,
.wizard-input input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.wizard-input input[type=number] { -moz-appearance: textfield; }

.tg-link { color: inherit; text-decoration: none; }
.tg-link strong { text-decoration: underline; text-underline-offset: 3px; }

.marketplace-badge--both { background: linear-gradient(90deg, #3b82f6, #f97316); }


/* Wizard marketplace choice */
.wizard-marketplace{
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 12px;
  background: rgba(0,0,0,.02);
}
.wizard-radio{
  display:flex;
  align-items:center;
  gap:10px;
  margin-top:8px;
  font-size:14px;
}

.admin-review-comment {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.12);
  font: inherit;
  line-height: 1.35;
}

.admin-entry[hidden] { display: none !important; }

/* --- Docs modal --- */
.doc-modal { position: fixed; inset: 0; z-index: 9999; display: none; }
.doc-modal.is-open { display: block; }
.doc-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.55); }
.doc-modal__card {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(92vw, 720px); max-height: 86vh; overflow: hidden;
  background: #fff; border-radius: 18px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  display: flex; flex-direction: column;
}
.doc-modal__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 14px; border-bottom: 1px solid rgba(0,0,0,.08);
}
.doc-modal__body { padding: 14px 14px 18px; overflow: auto; }
.doc-link { text-decoration: underline; }
