:root {
  color-scheme: light;
  --bg: #f2fbfb;
  --shell: #ffffff;
  --panel: #ffffff;
  --panel-2: #f4fcfc;
  --panel-3: #e7f6f6;
  --panel-soft: #eff9f9;
  --line: #d3eeee;
  --line-strong: #4925fa;
  --text: #102426;
  --muted: #5c787a;
  --muted-2: #6e9092;
  --blue: #4925fa;
  --blue-strong: #0199a1;
  --blue-soft: #e5f7f7;
  --btn-fill: #4925fa;
  --btn-fill-hover: #0199a1;
  --btn-disabled-bg: #8ec8cb;
  --btn-disabled-fg: rgba(1, 51, 53, 0.55);
  --input-bg: #ffffff;
  --input-bg-focus: #fcfdff;
  --input-placeholder: #7d9c9e;
  --cta-fade: transparent;
  --cta-solid: transparent;
  --green: #2f9e6f;
  --green-soft: #edf9f3;
  --radius-xl: 28px;
  --radius-lg: 22px;
  --radius-md: 18px;
  --radius-sm: 14px;
  /* Keep the mobile step rail and setup spacing fixed unless the whole layout is redesigned. */
  --mobile-step-top-offset: 102px;
  --setup-top-offset: 4px;
  font-family: "Manrope", system-ui, sans-serif;
}

html.tg-mini-app,
html.tg-mini-app body {
  min-height: var(--tg-viewport-height, 100dvh);
  height: var(--tg-viewport-height, 100dvh);
}

html.tg-mini-app .app-shell {
  padding: 0;
  height: var(--tg-viewport-height, 100dvh);
  min-height: var(--tg-viewport-height, 100dvh);
}

html.tg-mini-app .workspace {
  width: 100%;
  max-width: none;
  height: 100%;
  border-radius: 0;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  touch-action: manipulation;
  overflow-x: hidden;
  background:
    linear-gradient(180deg, rgba(2, 168, 176, 0.03) 0%, rgba(2, 168, 176, 0.015) 100%),
    #f2fbfb;
  color: var(--text);
}

body.templates-mode,
body.setup-mode {
  overflow-x: hidden;
  overscroll-behavior-x: none;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
}

body.template-preview-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.app-shell {
  min-height: 100vh;
  min-height: var(--tg-viewport-height, 100dvh);
  height: var(--tg-viewport-height, 100dvh);
  display: grid;
  grid-template-rows: 1fr;
  padding: 12px;
  gap: 0;
  touch-action: manipulation;
  overflow: hidden;
  box-sizing: border-box;
}

.window-bar,
.workspace {
  width: min(100%, 1440px);
  margin: 0 auto;
}

.window-bar,
.topline {
  display: none !important;
}

.window-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
}

.window-bar__left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.window-chip,
.window-pill,
.topline-chip,
.chip {
  border-radius: 999px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
}

.window-chip {
  min-width: 34px;
  min-height: 34px;
  padding: 0 12px;
  display: inline-grid;
  place-items: center;
}

.window-chip--icon {
  width: 34px;
  padding: 0;
  font-size: 20px;
}

.window-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px 6px 8px;
  font-size: 14px;
  font-weight: 700;
}

.window-pill__mark,
.brand-card__logo {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
}

.window-pill__mark img,
.brand-card__logo img {
  display: block;
  width: 70%;
  height: auto;
}

.workspace {
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  border-radius: 20px;
  overflow: hidden;
  background: var(--shell);
  border: 1px solid var(--line);
}

.sidebar {
  background: var(--panel-2);
  border-right: 1px solid var(--line);
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.brand-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-card__logo {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  font-size: 24px;
}

.brand-card__logo img {
  width: 76%;
}

.brand-card__name {
  font-size: 16px;
  font-weight: 800;
}

.brand-card__meta {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.step-list,
.mobile-steps {
  display: grid;
  gap: 10px;
}

.step-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: transparent;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
  width: 100%;
  text-align: left;
}

.step-item.is-active {
  color: var(--blue);
  background: var(--blue-soft);
  border-color: #cddfff;
}

.step-item.is-complete {
  color: var(--green);
}

.step-item__index {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--panel-3);
  color: inherit;
  font-size: 12px;
  font-weight: 800;
  flex: 0 0 auto;
}

.step-item.is-active .step-item__index {
  background: var(--btn-fill);
  color: #fff;
}

.step-item.is-complete .step-item__index {
  background: var(--green-soft);
}

.step-item:disabled,
.mobile-step:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.result-payment-workspace {
  margin-bottom: 16px;
}

.result-payment-workspace__eyebrow {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-2);
  margin-bottom: 8px;
}

.result-payment-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.result-payment-actions .primary-btn,
.result-payment-actions .ghost-btn {
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.result-payment-actions .ghost-btn {
  width: min(100%, 620px);
  background: var(--panel-3);
  color: var(--text);
  border: 1px solid var(--line);
}

.result-payment-actions .ghost-btn:disabled {
  opacity: 1;
  color: var(--muted-2);
  background: var(--panel-2);
}

.sidebar-summary {
  margin-top: auto;
  border-radius: 18px;
  padding: 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.sidebar-summary__eyebrow {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 700;
}

.sidebar-summary__count {
  margin-top: 8px;
  color: var(--blue);
  font-size: 42px;
  line-height: 1;
  font-weight: 800;
}

.sidebar-summary__label {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.panel {
  background: var(--panel);
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.95);
}

.topline__title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topline__icon {
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
}

.result-card__icon.ui-lottie-icon {
  display: grid;
  place-items: center;
  background: transparent;
  color: transparent;
  border: 0;
  box-shadow: none;
}

.topline__icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 18px;
}

.topline__title {
  font-size: 20px;
  font-weight: 800;
}

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

.topline__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.topline-chip {
  min-width: 42px;
  min-height: 42px;
  padding: 0 14px;
  display: grid;
  place-items: center;
  font-weight: 800;
}

.topline-chip--theme {
  display: none;
}

.mobile-steps {
  display: none;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 14px 16px 0;
}

.mobile-steps-rail {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 14px 16px 0;
  position: relative;
  z-index: 20;
  overflow: visible;
}

.mobile-steps-rail .mobile-steps {
  display: grid;
  flex: 1;
  min-width: 0;
  padding: 0;
  gap: 5px;
}

.mobile-step {
  min-height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  width: 100%;
  padding: 0;
}

.mobile-step.is-active {
  background: var(--blue-soft);
  border-color: var(--line-strong);
  color: var(--blue);
}

.mobile-step.is-complete {
  color: var(--green);
}

.screen {
  flex: 1;
  padding: 28px 30px calc(24px + var(--keyboard-inset, 0px));
  overflow: auto;
  overflow-x: hidden;
  min-height: 0;
  max-width: 100%;
  scroll-padding-top: 16px;
  scroll-padding-bottom: calc(24px + var(--keyboard-inset, 0px));
}

#templatesScreen,
#setupScreen {
  overflow-x: hidden;
  max-width: 100%;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.section-head__title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.section-head__text {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  max-width: 700px;
}

.section-head--setup {
  justify-content: center;
  text-align: center;
  margin-bottom: 28px;
}

.section-head--setup .section-head__title {
  text-align: center;
}

.section-head--setup .section-head__text {
  max-width: 760px;
  margin-inline: auto;
  text-align: center;
}

.result-card__badge {
  display: inline-flex;
  justify-self: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

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

.option-card,
.payment-method,
.template-card,
.upload-zone,
.preview-panel,
.color-panel,
.slider-panel,
.summary-card,
.payment-card,
.result-card,
.template-board {
  border-radius: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.option-card,
.payment-method {
  padding: 18px;
  display: grid;
  gap: 8px;
  text-align: left;
}

.option-card.is-selected,
.payment-method.is-selected,
.template-card.is-selected {
  border-color: var(--line-strong);
  background: var(--panel-soft);
}

.option-card__top,
.payment-method__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.option-card__icon,
.payment-method__icon,
.upload-zone__media {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 20px;
}

.option-card__icon.ui-lottie-icon {
  width: 48px;
  height: 48px;
  border-radius: 0;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
  font-size: 0;
  color: transparent;
  justify-self: start;
}

.upload-zone__media {
  width: 72px;
  height: 72px;
  border-radius: 22px;
  font-size: 34px;
}

.upload-zone__media.ui-lottie-icon {
  width: 72px;
  height: 72px;
  border-radius: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  overflow: visible;
  font-size: 0;
  color: transparent;
}

.ui-lottie-icon__player,
.ui-lottie-icon .lottie-player {
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

.ui-lottie-icon--result {
  width: 72px;
  height: 72px;
  margin: 4px auto 0;
  border-radius: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: hidden;
  font-size: 0;
  position: relative;
}

.option-card__title,
.payment-method__title,
.template-board__title,
.summary-card__title,
.payment-card__title,
.upload-zone__title {
  font-size: 18px;
  font-weight: 800;
}

.option-card__text,
.payment-method__text,
.template-board__meta,
.summary-row__value,
.summary-card__meta,
.upload-zone__text,
.template-card__meta,
.result-card__text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.field-group {
  margin-top: 20px;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-top: 14px;
}

.result-actions .primary-btn--small,
.result-actions .ghost-btn--small {
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
  box-sizing: border-box;
}

.temp-cancel-pay-note,
.tempo-cancel-pay-btn {
  display: none !important;
}

.brand-focus-strip {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(76, 143, 247, 0.07);
}

.brand-focus-strip__label {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted-2);
  margin: 0 0 10px;
}

.brand-focus-strip__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.brand-focus-chip {
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
  max-width: 100%;
}

.brand-focus-chip.is-active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.field-label,
.preview-panel__label,
.divider-label {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.text-input {
  width: 100%;
  min-height: 56px;
  margin-top: 10px;
  border-radius: 16px;
  padding: 0 18px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, background 0.2s ease;
  color-scheme: inherit;
}

.text-input:focus {
  border-color: var(--blue);
  background: var(--input-bg-focus);
}

.text-input::placeholder {
  color: var(--input-placeholder);
}

.text-input--multiline {
  resize: vertical;
  min-height: 88px;
  padding-block: 12px;
  line-height: 1.35;
  font-family: inherit;
}

textarea.brand-text-input {
  resize: vertical;
  min-height: 56px;
  max-height: 120px;
  padding-block: 8px;
  padding-inline: 14px;
  margin-top: 8px;
  line-height: 1.42;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: none;
  text-align: left;
}

.field-attention-flash {
  animation: field-attention-red 1.05s ease;
}

@keyframes field-attention-red {
  0%,
  100% {
    box-shadow: 0 0 0 2px transparent;
  }
  35% {
    box-shadow: 0 0 0 3px rgba(224, 64, 64, 0.95);
    background: rgba(255, 226, 226, 0.52);
  }
  65% {
    box-shadow: 0 0 0 3px rgba(224, 64, 64, 0.45);
    background: rgba(255, 246, 246, 0.38);
  }}

.slug-step-card {
  display: grid;
  gap: 14px;
  text-align: center;
}

.slug-step-card__lead {
  margin: 0;
  padding: 0 4px;
  font-size: 15px;
  line-height: 1.52;
  color: var(--muted);
}

.slug-step-card__eyebrow {
  font-weight: 800;
  letter-spacing: 0.14em;
  font-size: 11px;
  color: rgba(118, 130, 150, 0.95);
  text-transform: uppercase;
}

.slug-step-card__input {
  text-align: left;
}

.slug-step-card__url-box {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.42;
  color: var(--text);
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.slug-step-card__url-link {
  color: var(--btn-fill);
  text-decoration: underline;
  word-break: break-all;
}

.slug-step-card__status {
  display: block;
  font-size: 12px;
  line-height: 1.42;
  color: var(--muted);
  white-space: pre-wrap;
}

.slug-step-card__foot-note {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  opacity: 0.92;
}

.slug-step-card__foot-note.hidden {
  display: none;
}

.result-queue-diy-banner {
  position: relative;
  display: grid;
  gap: 10px;
  margin-top: 16px;
  padding: 16px 40px 16px 16px;
  text-align: left;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  border-left: 3px solid var(--btn-fill);
  background:
    linear-gradient(135deg, rgba(2, 168, 176, 0.07) 0%, rgba(2, 168, 176, 0.02) 55%, transparent 100%),
    var(--panel-2);
  animation: result-queue-diy-in 320ms ease-out;
}

.result-queue-diy-banner.hidden {
  display: none;
}

@keyframes result-queue-diy-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }}

.result-queue-diy-banner__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted-2);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.result-queue-diy-banner__close:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--text) 7%, transparent);
}

.result-queue-diy-banner__eyebrow {
  font-weight: 800;
  letter-spacing: 0.12em;
  font-size: 11px;
  line-height: 1.2;
  color: var(--btn-fill);
  text-transform: uppercase;
}

.result-queue-diy-banner__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}

.result-queue-diy-banner__cta {
  width: 100%;
  margin-top: 2px;
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--btn-fill) 35%, var(--line));
  background: #fff;
  color: var(--btn-fill);
  font-weight: 700;
  font-size: 13px;
  line-height: 1.25;
  transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.result-queue-diy-banner__cta:hover:not(:disabled) {
  background: var(--blue-soft);
  border-color: color-mix(in srgb, var(--btn-fill) 55%, var(--line));
}

.result-queue-diy-banner__cta:disabled {
  opacity: 0.55;
  cursor: default;
}

.result-bot-start-banner {
  margin-bottom: 14px;
  border-left-color: #e0a100;
}

.brand-text-row {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  gap: 10px;
}

.brand-text-row__input {
  margin-top: 0 !important;
}

.brand-text-row__side {
  position: relative;
  display: grid;
  align-content: start;
}

.brand-font-trigger {
  appearance: none;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  padding: 10px 12px;
  line-height: 1.28;
  min-width: 148px;
  max-width: 220px;
  width: 100%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-align: left;
}

.brand-font-trigger__icon {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: color-mix(in srgb, var(--btn-fill) 18%, transparent);
  color: var(--btn-fill);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
}

.brand-font-trigger__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-font-trigger__chevron {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: 0.72;
}

.brand-font-trigger[aria-expanded="true"] .brand-font-trigger__chevron {
  transform: rotate(225deg) translateY(-1px);
}

.brand-font-popover {
  position: absolute;
  margin-top: 6px;
  right: 0;
  left: 0;
  display: grid;
  gap: 4px;
  padding: 8px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: 0 16px 40px rgba(20, 30, 50, 0.16);
  z-index: 12;
  max-height: min(220px, 42vh);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.brand-font-popover button {
  text-align: left;
  padding: 8px 10px;
  border-radius: 12px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.25;
  color: var(--text);
}

.brand-font-popover button:hover {
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.brand-font-popover button.is-selected {
  background: var(--btn-fill);
  color: #fff;
}

.result-slug-field-head {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.result-slug-field-head .field-label {
  flex: 0 0 auto;
  margin: 0;
  max-width: 42%;
}

.result-slug-field-hint {
  flex: 1 1 auto;
  font-size: 12px;
  line-height: 1.4;
  color: var(--muted);
  text-align: right;
  min-width: 0;
}

.result-slug-path-hint {
  margin-top: 0;
  min-height: 0;
  font-size: 13px;
}

#resultSlugSection {
  width: 100%;
  max-width: 100%;
  justify-self: stretch;
  text-align: left;
  margin-top: 4px;
}

#resultSlugSection .text-input {
  margin-top: 10px;
}

#resultSlugHint {
  margin-bottom: 0;
}

body.result-mode #restartBtn {
  margin-top: 18px;
}
.inline-hint {
  margin-top: 12px;
  min-height: 48px;
  border-radius: 14px;
  padding: 14px 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.chip-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}

.chip-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}

.templates-re-sep {
  grid-column: 1 / -1;
  height: 1px;
  margin: 10px 0 2px;
  background: rgba(15, 23, 42, 0.16);
  border-radius: 1px;
}

body.templates-mode .templates-re-sep {
  background: rgba(255, 255, 255, 0.22);
}

.chip {
  min-height: 36px;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.chip.is-active {
  background: var(--blue-soft);
  border-color: #cddfff;
  color: var(--blue);
}

/* Переключатель «весь раздел» — без подписи, серый / синий */
.category-bulk-toggle {
  width: 32px;
  height: 20px;
  flex-shrink: 0;
  border: 1px solid #d5deef;
  border-radius: 999px;
  background: #e4e9f2;
  padding: 0;
  position: relative;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.category-bulk-toggle::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
  transition: transform 0.15s ease;
}

.category-bulk-toggle.is-on {
  background: var(--btn-fill);
  border-color: var(--btn-fill);
}

.category-bulk-toggle.is-on::after {
  transform: translateX(12px);
}

.category-bulk-toggle:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.template-board {
  padding: 18px;
}

.template-board__head {
  margin-bottom: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ready-pack-back {
  flex: 0 0 auto;
  margin-top: 2px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ready-pack-back.hidden {
  display: none;
}

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

.ready-pack-card {
  grid-column: 1 / -1;
  position: relative;
  padding: 8px 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  cursor: pointer;
  color: inherit;
  min-height: 0;
}

.ready-pack-card.is-empty {
  cursor: default;
  opacity: 0.78;
}

.ready-pack-card.is-selected {
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}

.ready-pack-card--hit {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--panel), var(--panel)) padding-box,
    linear-gradient(
      135deg,
      color-mix(in srgb, #f8e7a0 55%, transparent),
      color-mix(in srgb, #c9a227 18%, transparent) 42%,
      color-mix(in srgb, #fff3c4 32%, transparent) 68%,
      color-mix(in srgb, #b8860b 16%, transparent)
    ) border-box;
  box-shadow:
    0 0 0 1px color-mix(in srgb, #e8c547 16%, transparent),
    0 0 18px color-mix(in srgb, #d4af37 12%, transparent);
}

.ready-pack-card--hit.is-selected {
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent),
    0 0 18px color-mix(in srgb, #d4af37 12%, transparent);
}

.ready-pack-card__thumb {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.ready-pack-card__copy {
  flex: 0 0 auto;
  width: min(36%, 132px);
  padding-right: 2px;
}

.ready-pack-card--hit .ready-pack-card__copy {
  padding-top: 16px;
}

.ready-pack-card__hit {
  position: absolute;
  top: 6px;
  right: 8px;
  left: auto;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border-radius: 999px;
  background: #ffd84a;
  color: #1a1400;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 6px 16px color-mix(in srgb, #ffd84a 35%, transparent);
}

.ready-pack-card__mosaic {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  height: 58px;
}

.ready-pack-card__cell {
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  overflow: hidden;
  border-radius: 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.ready-pack-card__cell--empty {
  opacity: 0.45;
}

.ready-pack-card__cell .template-preview-frame {
  width: 100%;
  height: 100%;
}

.template-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  column-gap: 14px;
  row-gap: 16px;
}

.template-grid.is-empty {
  grid-template-columns: 1fr;
}

.template-card {
  padding: 14px;
  display: grid;
  gap: 12px;
  text-align: left;
}

.template-card--skeleton {
  pointer-events: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.template-card--skeleton .template-card__visual,
.template-card__skeleton-line {
  border-radius: 10px;
  background: linear-gradient(
    90deg,
    var(--panel-2) 25%,
    color-mix(in srgb, var(--panel-2) 55%, var(--line)) 37%,
    var(--panel-2) 63%
  );
  background-size: 400% 100%;
  animation: template-skeleton-shimmer 1.4s ease-in-out infinite;
}

.template-card--skeleton .template-card__visual {
  aspect-ratio: 1 / 1;
  border-radius: 16px;
}

.template-card__skeleton-line {
  height: 10px;
}

.template-card__skeleton-line--short {
  width: 60%;
}

@keyframes template-skeleton-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }}

@media (prefers-reduced-motion: reduce) {
  .template-card--skeleton .template-card__visual,
  .template-card__skeleton-line {
    animation: none;
  }}

.template-card__thumb,
.preview-canvas {
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.summary-card__hero {
  background: transparent;
  border: 0;
  margin-top: 10px;
  margin-bottom: 2px;
  padding: 4px 0 8px;
  border-radius: 0;
}

.template-card__thumb {
  aspect-ratio: 1;
  border-radius: 16px;
  display: grid;
  place-items: center;
  overflow: hidden;
  position: relative;
  contain: paint;
  max-width: 100%;
}

.template-card__thumb .lottie-player,
.template-preview-frame {
  max-width: 100%;
  max-height: 100%;
  overflow: hidden;
  contain: paint;
}

.template-card--probe .template-card__thumb {
  min-height: 280px;
}

.template-card__thumb .lottie-player,
.template-preview-frame .lottie-player,
.template-preview-modal__visual .lottie-player {
  width: 100%;
  height: 100%;
}

/* Сетка 5 в ряд: чуть меньше, чтобы низ анимации не обрезался overflow у thumb. */
.template-card__thumb .lottie-player {
  width: 88%;
  height: 88%;
  justify-self: center;
  align-self: center;
}

.template-card__thumb .lottie-player svg,
.template-preview-frame .lottie-player svg,
.template-preview-modal__visual .lottie-player svg {
  width: 100% !important;
  height: 100% !important;
}

.template-preview-probe-grid {
  width: 100%;
  height: 100%;
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 8px;
  pointer-events: none;
}

.template-preview-probe {
  position: relative;
  min-height: 0;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(240, 247, 255, 0.98), rgba(255, 255, 255, 0.92));
  border: 1px solid rgba(210, 226, 248, 0.94);
}

.template-preview-probe--background {
  background-repeat: no-repeat;
  background-position: center;
  background-size: 78% 78%;
}

.template-preview-probe__label {
  position: absolute;
  left: 8px;
  bottom: 8px;
  z-index: 2;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(208, 223, 244, 0.92);
  color: var(--blue-strong);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  pointer-events: none;
}

.template-card__format {
  position: absolute;
  right: 10px;
  top: 10px;
  z-index: 2;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(2, 168, 176, 0.1);
  border: 1px solid rgba(2, 168, 176, 0.2);
  color: var(--blue-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.template-preview-probe__fallback,
.template-preview-probe__media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.template-preview-probe__fallback {
  display: grid;
  place-items: center;
  opacity: 0.9;
  pointer-events: none;
}

.template-preview-probe__fallback--text {
  align-items: end;
  justify-items: stretch;
  padding: 14px;
  opacity: 1;
}

.template-preview-probe__text-block {
  display: grid;
  gap: 4px;
  width: 100%;
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(208, 223, 244, 0.94);
}

.template-preview-probe__text-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--blue-strong);
}

.template-preview-probe__text-subtitle {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}

.template-preview-probe__fallback svg {
  width: 86%;
  height: 86%;
}

.template-preview-probe__media {
  display: block;
  border: 0;
  object-fit: contain;
  pointer-events: none;
}

.template-preview-probe--iframe .template-preview-probe__media {
  background: transparent;
}

.template-card__thumb[data-template-preview-loaded="1"] svg,
.template-preview-frame[data-template-preview-loaded="1"] svg {
  width: 100%;
  height: 100%;
}

.template-card__favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(219, 231, 248, 0.9);
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  z-index: 2;
}

.template-card__badge {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(219, 231, 248, 0.9);
  color: var(--blue-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  z-index: 2;
}

.template-card__title {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.template-card__meta {
  margin-top: 2px;
  line-height: 1.25;
  max-width: 100%;
}

.template-empty {
  min-height: 260px;
  border-radius: 24px;
  padding: 28px 22px;
  border: 1px dashed #cddfff;
  background: linear-gradient(180deg, rgba(234, 242, 255, 0.55), rgba(255, 255, 255, 0.96));
  display: grid;
  place-items: center;
  text-align: center;
}

.template-empty__inner {
  width: min(100%, 420px);
}

.template-empty__icon {
  width: 74px;
  height: 74px;
  margin: 0 auto 16px;
  border-radius: 24px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid #d7e5fb;
  color: var(--blue);
  font-size: 30px;
}

.template-empty__title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.template-empty__text {
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.template-preview-modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  padding: 28px 18px max(28px, env(safe-area-inset-bottom, 0));
  background: rgba(7, 16, 30, 0.42);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: grid;
  place-items: center;
}

.template-preview-modal__sheet {
  width: min(100%, 460px);
  display: grid;
  gap: 18px;
  justify-items: center;
}

.template-preview-modal__visual {
  width: min(100%, 300px);
  min-height: 300px;
  display: grid;
  place-items: center;
}

.template-preview-frame {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.template-preview-frame--card {
  min-height: 100%;
}

.template-preview-modal__visual svg {
  filter: drop-shadow(0 20px 40px rgba(6, 35, 82, 0.18));
}

.template-preview-modal__footer {
  width: 100%;
  display: grid;
  gap: 12px;
  padding: 20px 18px 18px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(219, 231, 248, 0.92);
  text-align: center;
}

.template-preview-modal__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.template-preview-modal__text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.upload-zone {
  position: relative;
  padding: 20px;
  border-style: dashed;
  text-align: center;
  display: grid;
  justify-items: center;
  gap: 8px;
}

.upload-zone__input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.divider-label {
  text-align: center;
  margin: 16px 0 10px;
}

.preview-panel,
.color-panel,
.slider-panel,
.summary-card,
.payment-card,
.payment-flow__card,
.result-card {
  padding: 20px;
}

.brand-workbench {
  display: grid;
  gap: 16px;
}

.preview-panel {
  margin-top: 10px;
}

.preview-canvas-wrap {
  position: relative;
  margin-top: 6px;
  border-radius: 22px;
  overflow: hidden;
}

.preview-canvas-wrap .preview-canvas {
  margin-top: 0;
}

.preview-canvas {
  margin-top: 6px;
  min-height: 280px;
  height: 280px;
  border-radius: 22px;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.brand-preview-stage {
  width: 100%;
  height: 100%;
  position: relative;
  display: grid;
  place-items: center;
}

.brand-preview-diagnostics {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.brand-preview-test-card {
  min-height: 210px;
  border-radius: 20px;
  padding: 12px;
  display: grid;
  gap: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
}

.brand-preview-test-card__head {
  display: grid;
  gap: 3px;
}

.brand-preview-test-card__title {
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.brand-preview-test-card__hint {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.brand-preview-test-card__frame {
  min-height: 140px;
  border-radius: 18px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  overflow: hidden;
}

.brand-preview-test-card__status {
  min-height: 18px;
  color: var(--muted-2);
  font-size: 11px;
  line-height: 1.35;
}

.brand-preview-json {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 12px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 11px;
  line-height: 1.45;
  color: #c44f4f;
  background: transparent;
}

.brand-preview-test-error {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 10px;
  color: #b54242;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.brand-preview-stage__animation {
  width: 100%;
  height: 100%;
}

.template-preview-frame--brand {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.template-preview-frame > svg,
.checkout-preview > svg {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 1;
}

.template-preview-frame .lottie-player {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: grid;
  place-items: center;
}

/* Чек‑аут: превью масштаб и лёгкий сдвиг внутри квадрата */
.checkout-preview .lottie-player {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: grid;
  place-items: center;
  transform: translateX(1px);
}

.brand-preview-stage__text {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  display: grid;
  place-items: center;
  font-weight: 800;
  line-height: 1.22;
  text-align: center;
  max-width: 100%;
  max-height: 100%;
  padding: 4px;
  text-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
}

.preview-canvas svg {
  width: 100%;
  height: 100%;
}

.color-panel {
  margin-top: 26px;
}

.slider-panel {
  margin-top: 16px;
}

.payment-flow {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

.payment-flow__card {
  border-radius: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  display: grid;
  gap: 12px;
}

.payment-flow__title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.payment-flow__text {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.payment-flow__actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.payment-flow__actions .primary-btn,
.payment-flow__actions .ghost-btn,
.payment-flow__actions .primary-btn--small,
.payment-flow__actions .ghost-btn--small {
  width: 100%;
  max-width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.field-group--compact {
  margin-top: 2px;
}

.ghost-btn--small,
.primary-btn--small {
  min-height: 44px;
  padding-inline: 18px;
}

.color-rows,
.slider-panel {
  display: grid;
  gap: 12px;
}

.color-row {
  min-height: 58px;
  border-radius: 16px;
  padding: 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.color-row__main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.color-row__name {
  font-size: 14px;
  font-weight: 700;
  flex: 0 0 auto;
}

.color-row__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1 1 auto;
  justify-content: flex-end;
}

.color-row__hex {
  width: 84px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--input-bg);
  color: var(--text);
  padding: 0 10px;
  text-transform: lowercase;
  flex: 0 0 auto;
}

.color-row input[type="color"] {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 0 2px rgba(94, 160, 255, 0.55);
  -webkit-appearance: none;
  appearance: none;
  padding: 0;
  border: none;
  background: transparent;
  overflow: hidden;
}

.color-row input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-row input[type="color"]::-webkit-color-swatch {
  border: none;
  border-radius: 50%;
}

.color-row input[type="color"]::-moz-color-swatch {
  border: none;
}

.color-row__strip {
  flex: 1 1 72px;
  min-width: 48px;
  max-width: 120px;
  height: 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background:
    linear-gradient(90deg, var(--fill-strip, #4925fa), var(--fill-strip, #4925fa)),
    repeating-conic-gradient(#c8c8c8 0% 25%, #ffffff 0% 50%) 0 0 / 8px 8px;
  background-blend-mode: normal;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.04);
}

.color-row__mode-btn {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  background: #d7dbe3;
  color: #111;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.color-row__mode-btn__icon {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid #111;
  margin-top: 2px;
  transition: transform 0.15s ease;
}

.color-row__mode-btn[aria-expanded="true"] {
  background: #c5cad4;
}

.color-row__mode-btn[aria-expanded="true"] .color-row__mode-btn__icon {
  margin-top: 0;
  margin-bottom: 2px;
  transform: rotate(180deg);
}

.color-row__fill-panel {
  display: grid;
  gap: 10px;
  padding-top: 2px;
}

.color-row__fill-panel.hidden {
  display: none;
}

.fill-mode-seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: #d8dce4;
}

.holo-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 2px 2px;
}

.holo-preset {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  padding: 0;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.12);
}

.holo-preset.is-active {
  border-color: #111;
  box-shadow: 0 0 0 2px rgba(2, 168, 176, 0.35);
}

body.brand-mode .holo-preset.is-active {
  border-color: #fff;
}

.holo-anim-seg {
  display: inline-flex;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: #d8dce4;
  flex: 0 0 auto;
  margin-left: 4px;
}

.holo-anim-seg__btn {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
}

.holo-anim-seg__btn.is-active {
  background: #fff;
  color: #111;
}

body.brand-mode .holo-anim-seg {
  background: rgba(255, 255, 255, 0.12);
}

body.brand-mode .holo-anim-seg__btn {
  color: rgba(255, 255, 255, 0.7);
}

body.brand-mode .holo-anim-seg__btn.is-active {
  background: rgba(255, 255, 255, 0.92);
  color: #111;
}

.fill-mode-seg__btn {
  border: 0;
  background: transparent;
  color: #4b5563;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.1;
  padding: 8px 6px;
  border-radius: 999px;
  cursor: pointer;
}

.fill-mode-seg__btn.is-active {
  background: #fff;
  color: #111;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
}

.grad-bar-wrap {
  display: grid;
  gap: 8px;
}

.grad-bar-wrap.hidden {
  display: none;
}

.grad-bar {
  position: relative;
  height: 14px;
  margin: 18px 6px 4px;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  /* Полоска всегда видна: --grad-bar-fill может быть самим linear-gradient(...). */
  background-color: #e8eaef;
  background-image:
    var(--grad-bar-fill, linear-gradient(90deg, #4925fa, #4925fa)),
    repeating-conic-gradient(#c8c8c8 0% 25%, #ffffff 0% 50%);
  background-size: auto, 8px 8px;
  background-repeat: no-repeat, repeat;
  cursor: copy;
  touch-action: none;
}

.grad-stop {
  position: absolute;
  top: -16px;
  width: 18px;
  height: 18px;
  margin-left: -9px;
  border-radius: 4px;
  border: 1.5px solid #9aa3b2;
  background:
    linear-gradient(var(--stop-color, #fff), var(--stop-color, #fff)),
    repeating-conic-gradient(#c8c8c8 0% 25%, #ffffff 0% 50%) 0 0 / 6px 6px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.18);
  cursor: grab;
  z-index: 1;
}

.grad-stop::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 0;
  height: 0;
  margin-left: -5px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #9aa3b2;
}

.grad-stop.is-active {
  border-color: #6a5cff;
  z-index: 2;
}

.grad-stop.is-active::after {
  border-top-color: #6a5cff;
}

.grad-stop__x {
  position: absolute;
  top: -10px;
  right: -10px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 0;
  background: #ef4444;
  color: #fff;
  font-size: 11px;
  line-height: 16px;
  text-align: center;
  padding: 0;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.25);
  z-index: 3;
}

.grad-alpha-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.grad-alpha {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  color: var(--muted);
}

.grad-alpha > span:first-child {
  flex: 0 1 auto;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 7.2em;
}

.grad-alpha__pct {
  flex: 0 0 2.2em;
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
}

.grad-alpha input[type="range"] {
  flex: 1 1 56px;
  width: 56px;
  max-width: 72px;
  min-width: 48px;
}

.grad-rotate-btn {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}

.grad-rotate-btn:hover {
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.grad-rotate-btn:active {
  transform: scale(0.96);
}

.preview-canvas-wrap,
.emojix-wm-host {
  position: relative;
}

.emojix-watermark {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 6;
  opacity: 0.015;
  border-radius: inherit;
}

.emojix-watermark.hidden {
  display: none !important;
}

.emojix-watermark__rail {
  position: absolute;
  inset: -30% -40%;
  display: flex;
  flex-direction: column;
  gap: 22px;
  transform: rotate(-18deg);
}

.emojix-watermark__row {
  display: flex;
  gap: 32px;
  width: max-content;
  animation: emojix-wm-slide 26s linear infinite;
}

.emojix-watermark__row:nth-child(even) {
  animation-name: emojix-wm-slide-rev;
  animation-duration: 30s;
}

.emojix-watermark__mark {
  height: 22px;
  width: auto;
  flex: 0 0 auto;
  display: block;
  filter: none;
  background: transparent;
}

@keyframes emojix-wm-slide {
  from { transform: translateX(-12%); }
  to { transform: translateX(-42%); }}

@keyframes emojix-wm-slide-rev {
  from { transform: translateX(-42%); }
  to { transform: translateX(-12%); }}

.slider-field {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
}

.slider-field input {
  width: 100%;
  accent-color: var(--blue);
}

.checkout-layout {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 16px;
}

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

.section-head.section-head--setup {
  justify-content: center;
  text-align: center;
}

.summary-card__hero {
  border-radius: 0;
  padding: 4px 0 8px;
  display: flex !important;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: transparent;
  border: 0;
  margin-top: 10px;
}

.summary-card__hero-main {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

/* Между названием набора и «Шаблоны» полоску убираем — она «прилипала» к hero. */
.summary-card__hero + .summary-row {
  border-top: 0;
  padding-top: 6px;
}

.summary-row__label {
  color: var(--muted);
  font-size: 13px;
}

.summary-row__value strong {
  color: var(--text);
  font-size: 15px;
}

.checkout-preview-block {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
  padding-top: 2px;
}

.checkout-preview-strip {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 12px 0 4px;
  scrollbar-width: none;
}

.checkout-preview-strip::-webkit-scrollbar {
  display: none;
}

.checkout-preview-strip__more {
  flex: 0 0 auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 2px;
  margin-right: 4px;
  padding: 8px 12px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--muted);
  cursor: pointer;
}

.checkout-preview-strip__more:active {
  transform: scale(0.98);
}

.checkout-preview-strip__eye {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  opacity: 0.85;
  white-space: nowrap;
}

.checkout-preview-stage {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  position: relative;
  cursor: pointer;
  overflow: hidden;
  border-radius: 18px;
}

.checkout-preview {
  width: 100%;
  height: 100%;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  overflow: hidden;
  padding: 5px;
}

.checkout-preview-stage > .emojix-watermark,
.emojix-watermark--thumb {
  border-radius: 18px;
  z-index: 4;
}

.emojix-watermark--thumb .emojix-watermark__rail {
  gap: 12px;
  inset: -45% -65%;
}

.emojix-watermark--thumb .emojix-watermark__row {
  gap: 14px;
}

.emojix-watermark--thumb .emojix-watermark__mark {
  height: 12px;
}

.checkout-preview-stage__text {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  display: grid;
  place-items: center;
  font-weight: 800;
  line-height: 1.22;
  text-align: center;
  max-width: 100%;
  max-height: 100%;
  padding: 4px;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
}

.checkout-preview .lottie-player svg {
  width: 74% !important;
  height: 74% !important;
  transform: none;
}

.checkout-preview > svg {
  width: 100%;
  height: 100%;
  transform: none;
}

.payment-card {
  display: grid;
  gap: 14px;
}

.payment-balance {
  min-height: 0;
  padding-block: 12px;
  font-size: 12px;
}

.payment-balance--active {
  border-color: #cfe1ff;
  background: var(--blue-soft);
  color: var(--blue);
}

.result-card {
  width: min(100%, 560px);
  margin: 8vh auto 0;
  text-align: center;
  display: grid;
  gap: 14px;
  max-width: 100%;
  box-sizing: border-box;
  min-width: 0;
  overflow: hidden;
  padding-inline: 4px;
}

.result-card__badge {
  background: var(--green-soft);
  color: var(--green);
}

.result-card__icon {
  width: 88px;
  height: 88px;
  margin: 4px auto 0;
  border-radius: 0;
  border: 0;
  background: transparent;
  font-size: 42px;
}

.result-actions {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  margin-top: 14px;
}

.result-actions .primary-btn--small,
.result-actions .ghost-btn--small,
.result-actions .primary-btn,
.result-actions .ghost-btn {
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
  box-sizing: border-box;
}

.slug-step-card__url-box {
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.42;
  color: var(--text);
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.slug-step-card__url-link {
  color: var(--btn-fill);
  text-decoration: underline;
  word-break: break-all;
}

.result-card__title {
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.result-card__link.primary-btn {
  width: 100%;
  max-width: 100%;
  margin-inline: 0;
  box-sizing: border-box;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-card__link {
  width: 100%;
}

.bottom-cta {
  position: sticky;
  bottom: 0;
  padding-top: 18px;
  margin-top: 18px;
  background: transparent;
  box-shadow: none;
  z-index: 4;
}

.primary-btn,
.ghost-btn {
  min-height: 56px;
  border-radius: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.primary-btn {
  width: min(100%, 620px);
  margin: 0 auto;
  display: grid;
  place-items: center;
  padding: 0 18px;
  color: #ffffff;
  background: var(--btn-fill);
}

.primary-btn:hover {
  background: var(--btn-fill-hover);
}

.primary-btn:disabled {
  opacity: 1;
  cursor: not-allowed;
  background: var(--btn-disabled-bg);
  color: var(--btn-disabled-fg);
  box-shadow: none;
  filter: none;
}

.primary-btn:disabled:hover {
  background: var(--btn-disabled-bg);
  color: var(--btn-disabled-fg);
}

.primary-btn--wide {
  width: min(100%, 920px);
}

.primary-btn--small {
  min-height: 42px;
  width: auto;
  padding: 0 18px;
}

.primary-btn--compact,
.ghost-btn--compact {
  min-height: 50px;
  width: 100%;
  padding: 0 22px;
  font-size: 16px;
}

.ghost-btn {
  width: min(100%, 620px);
  margin: 0 auto;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--line);
}

.bottom-cta--templates {
  display: block;
  padding-bottom: 4px;
  position: sticky;
  bottom: 0;
  z-index: 12;
  background: linear-gradient(to top, var(--panel) 72%, color-mix(in srgb, var(--panel) 0%, transparent));
}

body.templates-mode #templatesScreen {
  padding-bottom: 110px;
}

.bottom-cta--templates .primary-btn--compact {
  margin: 0 auto;
  width: min(100%, 420px);
}

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

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

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

  .sidebar {
    display: none;
  }

  .mobile-steps {
    display: none;
  }

  .mobile-steps-rail {
    display: flex;
  }

  .screen {
    padding: 20px 16px calc(20px + var(--keyboard-inset, 0px));
  }

  .topline {
    padding: 16px;
  }

  .checkout-layout,
  .option-grid,
  .payment-grid {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 720px) {
  .app-shell {
    padding: 0;
    gap: 0;
    min-height: var(--tg-viewport-height, 100svh);
    background: transparent;
  }

  .window-bar {
    display: none;
  }

  .workspace {
    min-height: 0;
    height: 100%;
    width: 100%;
    border-radius: 0;
    border: 0;
  }

  .mobile-steps-rail {
    padding: var(--mobile-step-top-offset) 14px 0;
    gap: 6px;
  }

  .mobile-steps-rail .mobile-steps {
    gap: 4px;
  }

  .mobile-step {
    min-height: 32px;
    font-size: 11px;
    border-radius: 10px;
  }

  .profile-avatar-slot {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
  }

  .profile-avatar {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    max-width: 38px;
    max-height: 38px;
    flex-basis: 38px;
  }

  .profile-avatar__chevron {
    width: 16px;
    height: 16px;
  }

  .screen {
    padding: 18px 14px calc(22px + var(--keyboard-inset, 0px));
    scroll-padding-top: 12px;
    scroll-padding-bottom: calc(22px + var(--keyboard-inset, 0px));
  }

  .section-head--setup {
    margin-top: 8px;
    margin-bottom: 20px;
  }

  .section-head--setup .section-head__title {
    font-size: 28px;
    line-height: 1.05;
    text-align: center;
  }

  .section-head--setup .section-head__text {
    font-size: 15px;
    line-height: 1.45;
    max-width: 340px;
    margin-inline: auto;
    text-align: center;
  }

  .template-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    column-gap: 8px;
    row-gap: 10px;
  }

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

  .template-empty {
    min-height: 236px;
    padding: 24px 18px;
    border-radius: 22px;
  }

  .template-empty__icon {
    width: 66px;
    height: 66px;
    border-radius: 22px;
    font-size: 28px;
  }

  .template-empty__title {
    font-size: 18px;
  }

  .template-empty__text {
    font-size: 13px;
  }

  .template-board {
    border: 0;
    padding: 0;
    background: transparent;
  }

  .template-board__head {
    margin-bottom: 12px;
    padding: 0 4px;
  }

  .template-board__title {
    font-size: 28px;
    line-height: 1;
  }

  .template-board__meta {
    margin-top: 4px;
    font-size: 14px;
  }

  .template-card {
    padding: 0;
    gap: 9px;
    border: 0;
    background: transparent;
  }

  .template-card__title {
    font-size: 13px;
  }

  .template-card__meta {
    font-size: 10px;
    line-height: 1.2;
  }

  .template-card > div:last-child {
    padding: 0 4px;
  }

  .template-card__thumb {
    width: 100%;
  }

  .template-card--probe {
    grid-column: 1 / -1;
  }

  .template-preview-probe-grid {
    grid-template-rows: repeat(5, minmax(82px, 1fr));
    gap: 6px;
    padding: 6px;
  }

  .template-card__favorite {
    top: 8px;
    right: 8px;
    min-width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .template-card.is-selected {
    border: 0;
    background: transparent;
  }

  .template-card.is-selected .template-card__thumb {
    border-color: var(--blue);
  }

  .preview-canvas {
    min-height: 220px;
    height: 220px;
  }

  .brand-preview-diagnostics {
    grid-template-columns: 1fr;
  }

  .brand-preview-test-card {
    min-height: 190px;
  }

  .primary-btn,
  .ghost-btn,
  .primary-btn--wide {
    width: 100%;
  }

  .bottom-cta--templates {
    position: fixed;
    left: 14px;
    right: 14px;
    bottom: 14px;
    margin-top: 0;
    padding: 12px 0 calc(env(safe-area-inset-bottom, 0) + 6px);
    background: transparent;
    box-shadow: none;
    z-index: 12;
  }

  .bottom-cta--templates .primary-btn--compact {
    width: min(100%, 340px);
  }

  /* Soft keyboard open: fixed/sticky CTA must not steal taps meant for system keys */
  body.keyboard-open .bottom-cta,
  body.keyboard-open .bottom-cta--templates {
    pointer-events: none;
  }

  body.templates-mode #templatesScreen {
    padding-top: 18px;
    padding-bottom: 110px;
  }

  body.brand-mode #brandScreen {
    padding-top: 18px;
  }

  body.checkout-mode #checkoutScreen {
    padding-top: 18px;
  }

  body.checkout-mode #checkoutScreen .checkout-preview {
    flex-basis: 64px;
    width: 64px;
    height: 64px;
    border-radius: 16px;
  }

  body.setup-mode .topline,
  body.templates-mode .topline,
  body.brand-mode .topline,
  body.checkout-mode .topline,
  body.result-mode .topline {
    display: none;
  }

  body.brand-mode #brandScreen .section-head,
  body.checkout-mode #checkoutScreen .section-head,
  body.result-mode #resultScreen .section-head {
    display: none;
  }

  body.setup-mode #setupScreen {
    padding-top: 10px;
    /* Кнопка в потоке: при открытой клавиатуре не прилипает к visual viewport и не «поднимается» */
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
    min-height: calc(var(--tg-viewport-height, 100svh) - 132px);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
  }

  .section-head--setup {
    margin-top: 4px;
  }

  body.setup-mode #setupScreen > :first-child {
    margin-top: 0;
  }

  body.setup-mode #setupScreen .bottom-cta {
    position: static;
    width: 100%;
    margin-top: 8px;
    padding: 16px 0 calc(8px + env(safe-area-inset-bottom, 0));
    background: transparent;
    box-shadow: none;
    z-index: auto;
  }

  body.setup-mode #setupScreen .bottom-cta .primary-btn {
    width: min(100%, 340px);
    margin-inline: auto;
  }

  .template-preview-modal {
    padding: 20px 14px calc(env(safe-area-inset-bottom, 0) + 18px);
  }

  .template-preview-modal__sheet {
    width: min(100%, 360px);
    gap: 14px;
  }

  .template-preview-modal__visual {
    width: min(100%, 260px);
    min-height: 260px;
  }

  .template-preview-modal__footer {
    border-radius: 24px;
    padding: 18px 16px 16px;
  }

  .template-preview-modal__title {
    font-size: 20px;
  }

  .template-preview-modal__text {
    font-size: 13px;
  }

  body.brand-mode #brandScreen .inline-hint {
    display: none;
  }

  body.brand-mode #brandScreen .divider-label {
    margin: 14px 0 10px;
  }

  body.checkout-mode #checkoutScreen .payment-flow__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body.result-mode #resultScreen .result-payment-actions,
  body.result-mode #resultScreen .result-actions,
  body.result-mode #resultScreen .payment-flow__actions {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }

  body.result-mode #resultScreen .result-payment-actions .primary-btn,
  body.result-mode #resultScreen .result-payment-actions .ghost-btn,
  body.result-mode #resultScreen .result-actions .primary-btn,
  body.result-mode #resultScreen .result-actions .ghost-btn,
  body.result-mode #resultScreen .payment-flow__actions .primary-btn,
  body.result-mode #resultScreen .payment-flow__actions .ghost-btn {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }

  body.result-mode #resultScreen #restartBtn {
    margin-top: 16px;
    width: 100%;
  }

  body.checkout-mode #checkoutScreen .payment-flow__card {
    padding: 16px;
    gap: 10px;
  }

  body.brand-mode #brandScreen #brandNameInput {
    margin-top: 0;
    margin-bottom: 14px;
  }

  body.brand-mode .brand-text-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body.brand-mode .brand-font-trigger {
    width: 100%;
    max-width: none;
  }

  body.brand-mode .brand-workbench {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 12px;
  }

  body.brand-mode .preview-panel,
  body.brand-mode .color-panel {
    margin-top: 0;
    padding: 14px;
    border: 0;
    background: transparent;
  }

  body.brand-mode .preview-canvas {
    min-height: 220px;
    height: 220px;
    border-radius: 18px;
  }

  body.brand-mode .preview-canvas svg {
    width: 100%;
    height: 100%;
  }

  body.brand-mode .color-row {
    min-height: 48px;
    padding: 8px 10px;
    border-radius: 14px;
    display: grid;
    gap: 8px;
  }

  body.brand-mode .color-row__name {
    font-size: 12px;
  }

  body.brand-mode .color-row__controls {
    justify-content: flex-end;
    gap: 6px;
  }

  body.brand-mode .color-row__hex {
    width: 68px;
    height: 30px;
    padding: 0 6px;
    font-size: 11px;
  }

  body.brand-mode .color-row input[type="color"] {
    width: 30px;
    height: 30px;
    padding: 0;
    overflow: hidden;
  }

  body.brand-mode .color-row__strip {
    height: 8px;
    max-width: 88px;
  }

  body.brand-mode .color-row__mode-btn {
    width: 26px;
    height: 26px;
  }

  body.brand-mode .fill-mode-seg__btn {
    font-size: 11px;
    padding: 7px 4px;
  }

  body.brand-mode .slider-panel {
    margin-top: 12px;
    padding: 14px;
  }

  body.result-mode #resultScreen {
    padding-top: 18px;
  }

  body.result-mode .result-card {
    margin: 9vh auto 0;
    width: min(100%, 360px);
    max-width: calc(100% - 8px);
    justify-items: stretch;
    text-align: center;
    overflow: hidden;
  }

  body.result-mode .result-card__icon {
    width: 64px;
    height: 64px;
    border-radius: 0;
    font-size: 32px;
    justify-self: center;
    background: transparent;
    border: 0;
  }

  body.result-mode .result-card__title {
    font-size: 28px;
  }

  body.result-mode .result-card__text {
    max-width: min(100%, 340px);
    margin-inline: auto;
  }

  @media (max-width: 380px) {
    .result-slug-field-head {
      flex-wrap: wrap;
    }

    .result-slug-field-head .field-label {
      max-width: none;
    }

    .result-slug-field-hint {
      flex: 1 1 100%;
      text-align: left;
      margin-top: 6px;
    }}}

/* —— Profile avatar + sheet —— */
.profile-avatar-slot {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  overflow: visible;
}

.profile-avatar {
  position: relative;
  width: 42px;
  height: 42px;
  min-width: 42px;
  min-height: 42px;
  max-width: 42px;
  max-height: 42px;
  flex: 0 0 42px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  padding: 0;
  border: 2px solid color-mix(in srgb, var(--btn-fill) 55%, white);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.55), transparent 55%),
    linear-gradient(145deg, color-mix(in srgb, var(--btn-fill) 18%, white), #d7e8ff);
  box-shadow: 0 6px 16px rgba(2, 168, 176, 0.18);
  overflow: hidden;
  display: grid;
  place-items: center;
  align-self: center;
  box-sizing: border-box;
  line-height: 0;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

html[data-theme="dark"] .profile-avatar {
  border-color: #6a6a6a;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.12), transparent 55%),
    linear-gradient(145deg, #2a2a2a, #1a1a1a);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.45);
  color: #f0f0f0;
}

html[data-theme="blues"] .profile-avatar {
  border-color: rgba(255, 255, 255, 0.75);
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.35), transparent 55%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.28), rgba(90, 160, 230, 0.55));
  box-shadow: 0 4px 14px rgba(0, 30, 80, 0.35);
  color: #fff;
}

html[data-theme="dark"] .profile-avatar__chevron,
html[data-theme="blues"] .profile-avatar__chevron {
  background: rgba(20, 20, 20, 0.92);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.35);
}

.profile-avatar:active {
  transform: scale(0.96);
}

.profile-avatar.is-open {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--blue) 28%, transparent);
}

.profile-avatar__media {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  color: var(--blue-strong);
  letter-spacing: -0.02em;
}

.profile-avatar__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: 50%;
}

.profile-avatar__chevron {
  position: absolute;
  right: -2px;
  bottom: -2px;
  z-index: 8;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--shell);
  color: var(--blue);
  border: 1.5px solid color-mix(in srgb, var(--blue) 35%, var(--line));
  box-shadow: 0 2px 8px rgba(18, 32, 51, 0.12);
  padding: 0;
  pointer-events: none;
}

.profile-avatar-slot .profile-avatar--creator {
  z-index: 1;
}

.profile-avatar-slot .profile-avatar--creator + .profile-avatar__chevron,
.profile-avatar-slot:has(.profile-avatar--creator) .profile-avatar__chevron {
  z-index: 12;
  right: -5px;
  bottom: -5px;
  width: 17px;
  height: 17px;
  background: var(--shell);
  border-color: color-mix(in srgb, #d4a017 65%, var(--line));
  box-shadow: 0 2px 8px rgba(184, 134, 11, 0.32);
}

.profile-avatar--lg {
  width: 56px;
  height: 56px;
  min-width: 56px;
  min-height: 56px;
  max-width: 56px;
  max-height: 56px;
  flex-basis: 56px;
  border-width: 2.5px;
}

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

@keyframes creator-gold-shine {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 200% 50%;
  }
}

.profile-avatar--creator,
.profile-avatar--lg.profile-avatar--creator,
html[data-theme="dark"] .profile-avatar--creator,
html[data-theme="blues"] .profile-avatar--creator {
  overflow: visible;
  border: 0 !important;
  background: transparent !important;
  box-shadow:
    0 0 0 1px rgba(212, 160, 23, 0.35),
    0 0 14px rgba(245, 215, 110, 0.45),
    0 4px 14px rgba(184, 134, 11, 0.3);
}

.profile-avatar--creator::before,
.profile-avatar--lg.profile-avatar--creator::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  z-index: 0;
  /* Было 1→2→3; порядок: 2, 3, 1 */
  background: conic-gradient(
    from 0deg,
    #f8e7a0 0%,
    #d4a017 14%,
    #8a6a12 28%,
    #fff8d6 42%,
    #c9971a 56%,
    #f5d76e 72%,
    #b8860b 86%,
    #f8e7a0 100%
  );
  animation: creator-ring-spin 2.8s linear infinite;
}

.profile-avatar--creator::after,
.profile-avatar--lg.profile-avatar--creator::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  z-index: 1;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.55), transparent 55%),
    linear-gradient(145deg, #fff8e8, #f0e0a8 45%, #e8d48a);
  box-shadow: inset 0 0 0 1px rgba(212, 160, 23, 0.2);
}

html[data-theme="dark"] .profile-avatar--creator::after,
html[data-theme="blues"] .profile-avatar--creator::after {
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 248, 214, 0.2), transparent 55%),
    linear-gradient(145deg, #3a3018, #2a2210);
}

.profile-avatar--creator .profile-avatar__media,
.profile-avatar--lg.profile-avatar--creator .profile-avatar__media {
  position: relative;
  z-index: 2;
}

.profile-avatar--creator.is-open,
.profile-avatar--lg.profile-avatar--creator.is-open {
  box-shadow:
    0 0 0 3px rgba(212, 160, 23, 0.4),
    0 0 16px rgba(245, 215, 110, 0.5),
    0 4px 14px rgba(184, 134, 11, 0.35);
}

.profile-sheet__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.profile-creator-badge {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: none;
  /* Было 1→2→3; порядок: 2, 3, 1 */
  background: linear-gradient(
    105deg,
    #f5d76e 0%,
    #fff8d0 18%,
    #8a6a12 36%,
    #d4a017 52%,
    #f5d76e 70%,
    #fff1b0 84%,
    #b8860b 100%
  );
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
  animation: creator-gold-shine 2.4s linear infinite;
}

.profile-creator-badge.hidden {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .profile-avatar--creator::before,
  .profile-avatar--lg.profile-avatar--creator::before,
  .profile-creator-badge {
    animation: none;
  }

  .profile-creator-badge {
    background-position: 40% 50%;
  }
}

.profile-balance-now {
  margin-top: 8px;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.profile-topup-methods {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.profile-topup-method {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  text-align: left;
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}

.profile-topup-method.is-active {
  border-color: color-mix(in srgb, var(--blue) 55%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--blue) 35%, transparent);
}

.templates-re-heading {
  grid-column: 1 / -1;
  margin: 4px 0 2px;
}

.templates-re-heading__title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.templates-re-heading__meta {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.profile-avatar--lg .profile-avatar__media {
  font-size: 20px;
}

.profile-avatar--sidebar {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  max-width: 44px;
  max-height: 44px;
  flex: 0 0 44px;
}

.sidebar-profile {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  margin: 8px 4px 4px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--panel-2);
  border: 1px solid var(--line);
  cursor: pointer;
  min-width: 0;
}

.sidebar-profile__avatar-wrap {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  max-width: 44px;
  max-height: 44px;
  position: relative;
  align-self: center;
  overflow: visible;
}

.sidebar-profile__avatar-wrap .profile-avatar {
  position: absolute;
  inset: 0;
  width: 44px;
  height: 44px;
}

.sidebar-profile__meta {
  min-width: 0;
  flex: 1 1 auto;
}

.sidebar-profile__name {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sidebar-profile__hint {
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}

.profile-sheet {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  align-items: end;
  justify-items: stretch;
  pointer-events: none;
}

.profile-sheet:not(.hidden) {
  pointer-events: auto;
}

.profile-sheet__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(10, 18, 32, 0.38);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  animation: profileFade 0.2s ease;
}

.profile-sheet__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 440px);
  max-height: min(78dvh, 640px);
  margin: 0 auto;
  border-radius: 24px 24px 0 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--panel) 92%, white), var(--panel)),
    var(--panel);
  border: 1px solid var(--line);
  border-bottom: 0;
  box-shadow: 0 -18px 48px rgba(8, 24, 48, 0.22);
  padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 14px;
  animation: profileRise 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes profileFade {
  from { opacity: 0; }
  to { opacity: 1; }}

@keyframes profileRise {
  from { transform: translateY(28px); opacity: 0.4; }
  to { transform: translateY(0); opacity: 1; }}

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

.profile-sheet__identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  overflow: visible;
}

.profile-sheet__identity .profile-avatar--creator {
  margin: 3px;
}

.profile-sheet__title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.03em;
  min-width: 0;
}

.profile-sheet__subtitle {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
}

.profile-sheet__close {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

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

.profile-stat {
  padding: 10px 8px;
  border-radius: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  text-align: center;
}

.profile-stat__value {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.profile-stat__label {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
}

.profile-sheet__tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border-radius: 14px;
  background: var(--panel-3);
  border: 1px solid var(--line);
}

.profile-tab {
  min-height: 36px;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 0 4px;
}

.profile-tab.is-active {
  background: var(--shell);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(18, 32, 51, 0.08);
}

.profile-sheet__body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
}

.profile-pane.hidden {
  display: none !important;
}

.profile-empty {
  padding: 28px 12px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

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

.profile-card {
  display: grid;
  gap: 8px;
  padding: 12px 14px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  text-align: left;
}

.profile-card__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.profile-card__main {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 4px;
}

.profile-card__title {
  font-size: 14px;
  font-weight: 800;
}

.profile-card__meta {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
}

.profile-card__badge {
  display: inline-flex;
  align-self: start;
  flex-shrink: 0;
  margin-top: 0;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--blue-soft);
  color: var(--blue-strong);
}

.profile-card__badge.is-wait {
  background: color-mix(in srgb, #e8a317 18%, transparent);
  color: #b7791f;
}

.profile-card__resume {
  justify-self: start;
  margin-top: 2px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.profile-card__resume:active {
  opacity: 0.75;
}

.profile-card__badge.is-ok {
  background: color-mix(in srgb, var(--btn-fill) 18%, transparent);
  color: var(--btn-fill);
}

.profile-card__badge.is-cancel {
  background: rgba(196, 79, 79, 0.14);
  color: #c44f4f;
}

.profile-settings {
  display: grid;
  gap: 14px;
}

.profile-settings__block {
  padding: 14px;
  border-radius: 16px;
  background: var(--panel-2);
  border: 1px solid var(--line);
}

.profile-settings__block--soft {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--blue) 10%, transparent), transparent 60%),
    var(--panel-2);
}

.profile-settings__label {
  font-size: 14px;
  font-weight: 800;
}

.profile-settings__text,
.profile-settings__hint {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.profile-settings__row {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-promo-form {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.profile-promo-input {
  flex: 1 1 140px;
  min-width: 0;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-promo-btn {
  height: 42px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.profile-promo-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

#profilePromoHint.is-error {
  color: #c44f4f;
}

#profilePromoHint.is-ok {
  color: #2f9b63;
}

.theme-picker {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.lang-picker {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

.lang-swatch {
  flex: 1;
  padding: 12px 10px;
  border-radius: 14px;
  background: var(--shell);
  border: 1px solid var(--line);
  color: var(--text);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.lang-swatch.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 25%, transparent);
  color: var(--blue);
}

.theme-swatch {
  display: grid;
  gap: 8px;
  justify-items: center;
  padding: 10px 8px;
  border-radius: 14px;
  background: var(--shell);
  border: 1px solid var(--line);
  color: var(--text);
}

.theme-swatch.is-active {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 25%, transparent);
}

.theme-swatch__preview {
  width: 100%;
  aspect-ratio: 1.35;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.theme-swatch__preview--light {
  background: linear-gradient(145deg, #f7faff, #dcecff 55%, #ffffff);
}

.theme-swatch__preview--dark {
  background: linear-gradient(145deg, #141414, #2a2a2a 55%, #0a0a0a);
}

.theme-swatch__preview--blues {
  background:
    radial-gradient(ellipse 90% 70% at 18% 12%, rgba(120, 190, 255, 0.55), transparent 58%),
    radial-gradient(ellipse 80% 65% at 88% 78%, rgba(50, 120, 220, 0.4), transparent 55%),
    linear-gradient(165deg, #061830 0%, #0c3568 48%, #1a5a9a 100%);
}

.theme-swatch__name {
  font-size: 12px;
  font-weight: 700;
}

/* Themes */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0a0a0a;
  --shell: #121212;
  --panel: #141414;
  --panel-2: #1a1a1a;
  --panel-3: #222222;
  --panel-soft: #181818;
  --line: #262626;
  --line-strong: #5c5c5c;
  --text: #e6e6e6;
  --muted: #9a9a9a;
  --muted-2: #7a7a7a;
  --blue: #7eb0ff;
  --blue-strong: #a8c9ff;
  --blue-soft: #1f1f1f;
  --btn-fill: #3d7dd9;
  --btn-fill-hover: #5a94e6;
  --btn-disabled-bg: #2c2c2c;
  --btn-disabled-fg: rgba(255, 255, 255, 0.38);
  --input-bg: #1a1a1a;
  --input-bg-focus: #222222;
  --input-placeholder: #7a7a7a;
  --cta-fade: transparent;
  --cta-solid: transparent;
  --green: #4ecf95;
  --green-soft: #1a2e24;
}

html[data-theme="dark"] body {
  background: #0a0a0a;
}

html[data-theme="blues"] {
  color-scheme: dark;
  --bg: #071a36;
  --shell: rgba(255, 255, 255, 0.12);
  --panel: rgba(255, 255, 255, 0.14);
  --panel-2: rgba(255, 255, 255, 0.1);
  --panel-3: rgba(120, 190, 255, 0.16);
  --panel-soft: rgba(180, 220, 255, 0.12);
  --line: rgba(180, 220, 255, 0.28);
  --line-strong: #ffffff;
  /* Фирменный синий в текстах → белый; заливка кнопок отдельно. */
  --blue: #ffffff;
  --blue-strong: #ffffff;
  --blue-soft: rgba(255, 255, 255, 0.18);
  --btn-fill: #3d8fd9;
  --btn-fill-hover: #5aa6e8;
  --btn-disabled-bg: rgba(61, 143, 217, 0.32);
  --btn-disabled-fg: rgba(255, 255, 255, 0.48);
  --text: #f2f8ff;
  --muted: #d6e8f8;
  --muted-2: #c2d8ef;
  --input-bg: rgba(8, 28, 58, 0.72);
  --input-bg-focus: rgba(10, 36, 72, 0.88);
  --input-placeholder: rgba(210, 230, 255, 0.55);
  --cta-fade: transparent;
  --cta-solid: transparent;
  --green: #7dffc8;
  --green-soft: rgba(80, 220, 170, 0.18);
}

html[data-theme="blues"] body {
  background:
    radial-gradient(ellipse 120% 80% at 12% -8%, rgba(110, 185, 255, 0.28), transparent 62%),
    radial-gradient(ellipse 100% 70% at 100% 8%, rgba(45, 105, 210, 0.26), transparent 58%),
    radial-gradient(ellipse 90% 55% at 48% 108%, rgba(70, 150, 235, 0.16), transparent 60%),
    linear-gradient(168deg, #030d1c 0%, #071a38 28%, #0c2f5c 58%, #123f72 82%, #155089 100%);
  color: var(--text);
}

html[data-theme="blues"] .workspace,
html[data-theme="blues"] .panel,
html[data-theme="dark"] .workspace,
html[data-theme="dark"] .panel {
  background: var(--panel);
}

html[data-theme="blues"] .app-shell {
  background: transparent;
}

html[data-theme="dark"] .app-shell {
  background: transparent;
}

/* На тёмных темах белый текст на синей кнопке остаётся; активные чипы с color:var(--blue) уже белые в blues. */
html[data-theme="blues"] .primary-btn,
html[data-theme="dark"] .primary-btn {
  color: #fff;
}

/* Blues: избранное, превью, платежки */
html[data-theme="blues"] .template-card__favorite {
  color: var(--btn-fill);
  background: rgba(255, 255, 255, 0.95);
  border-color: rgba(61, 143, 217, 0.35);
}

html[data-theme="blues"] .template-preview-modal__footer {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(255, 255, 255, 0.55);
}

html[data-theme="blues"] .template-preview-modal__title {
  color: #141414;
}

html[data-theme="blues"] .template-preview-modal__text {
  color: #1f1f1f;
}

html[data-theme="blues"] .template-preview-modal__footer .primary-btn {
  background: var(--btn-fill);
  color: #fff;
}

html[data-theme="blues"] .template-preview-modal__footer .primary-btn:hover {
  background: var(--btn-fill-hover);
}

/* Dark: футер превью белый — заголовок шаблона чёрный, не серый от --text. */
html[data-theme="dark"] .template-preview-modal__footer {
  background: rgba(255, 255, 255, 0.96);
  border-color: rgba(255, 255, 255, 0.55);
}

html[data-theme="dark"] .template-preview-modal__title {
  color: #141414;
}

html[data-theme="dark"] .template-preview-modal__text {
  color: #3a3a3a;
}

html[data-theme="dark"] .template-preview-modal__footer .primary-btn {
  background: var(--btn-fill);
  color: #fff;
}

html[data-theme="blues"] .payment-method__title {
  color: #ffffff;
}

html[data-theme="blues"] .payment-method__text {
  color: rgba(255, 255, 255, 0.88);
}

html[data-theme="blues"] .payment-method.is-selected {
  background: rgba(255, 255, 255, 0.96);
  border-color: var(--btn-fill);
}

html[data-theme="blues"] .payment-method.is-selected .payment-method__title {
  color: var(--btn-fill);
}

html[data-theme="blues"] .payment-method.is-selected .payment-method__text {
  color: #2c2c2c;
}

html[data-theme="blues"] .payment-method.is-selected .payment-method__icon {
  background: color-mix(in srgb, var(--btn-fill) 16%, white);
  color: var(--btn-fill);
}

html[data-theme="dark"] .template-card__favorite,
html[data-theme="dark"] .template-card__badge {
  background: rgba(32, 32, 32, 0.92);
  border-color: rgba(90, 90, 90, 0.55);
  color: #c8c8c8;
}

html[data-theme="dark"] .bottom-cta,
html[data-theme="blues"] .bottom-cta,
html[data-theme="dark"] .bottom-cta--templates,
html[data-theme="blues"] .bottom-cta--templates {
  background: transparent;
  box-shadow: none;
}

@media (max-width: 720px) {
  html[data-theme="dark"] body.setup-mode #setupScreen .bottom-cta,
  html[data-theme="blues"] body.setup-mode #setupScreen .bottom-cta,
  html[data-theme="dark"] .bottom-cta--templates,
  html[data-theme="blues"] .bottom-cta--templates {
    background: transparent;
    box-shadow: none;
  }}

@media (min-width: 981px) {
  .profile-sheet {
    align-items: center;
    justify-items: end;
    padding: 24px;
  }

  .profile-sheet__panel {
    width: min(100%, 400px);
    max-height: min(86dvh, 720px);
    border-radius: 24px;
    border-bottom: 1px solid var(--line);
    margin: 0;
    animation-name: profileSlide;
  }

  @keyframes profileSlide {
    from { transform: translateX(24px); opacity: 0.3; }
    to { transform: translateX(0); opacity: 1; }}}