@font-face {
  font-family: "SB Sans Text";
  src: url("/assets/fonts/SBSansText-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SB Sans Text";
  src: url("/assets/fonts/SBSansText-Semibold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SB Sans Text";
  src: url("/assets/fonts/SBSansText-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "SB Sans Display";
  src: url("/assets/fonts/SBSansDisplay-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --page-bg: #000;
  --shell-bg: #080808;
  --form-bg: #191919;
  --color-text-primary: rgba(255, 255, 255, 0.96);
  --color-text-secondary: rgba(255, 255, 255, 0.56);
  --color-text-tertiary: rgba(255, 255, 255, 0.28);
  --color-text-on-light: rgba(8, 8, 8, 0.96);
  --color-status-negative: #ff293e;
  --color-status-positive: #85e396;
  --color-surface-negative: rgba(255, 41, 62, 0.2);
  --color-surface-primary: rgba(255, 255, 255, 0.05);
  --color-surface-hover: rgba(255, 255, 255, 0.08);
  --color-surface-secondary: rgba(255, 255, 255, 0.1);
  --color-surface-tertiary: rgba(255, 255, 255, 0.15);
  --color-surface-card: rgba(237, 255, 253, 0.05);
  --color-bg-card: #202020;
  --color-border-dark: rgba(8, 8, 8, 0.2);
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 1000px;
  --tool-panel-gap: 24px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
  background: var(--page-bg);
  color: var(--color-text-primary);
  font-family: "SB Sans Text", sans-serif;
}

body {
  min-width: 0;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
label,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.84);
  outline-offset: 2px;
}

.hidden,
[hidden] {
  display: none !important;
}

.app-shell {
  position: fixed;
  inset: 0;
  display: flex;
  min-width: 0;
  background: var(--shell-bg);
  overflow: hidden;
}

.sidebar {
  display: flex;
  flex: 0 0 214px;
  width: 214px;
  flex-direction: column;
  padding: 24px 12px 16px;
  background: var(--shell-bg);
}

.sidebar__logo {
  display: block;
  align-self: flex-start;
  margin: 0 0 30px 8px;
}

.sidebar__logo img {
  display: block;
  width: 166.5px;
  height: 20px;
  object-fit: contain;
}

.sidebar__groups {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

.sidebar__group-label {
  margin: 0;
  padding: 8px 6px;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 14px;
  letter-spacing: -0.24px;
}

.sidebar__list,
.sidebar__bottom {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar__bottom {
  margin-top: auto;
  padding-top: 8px;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 30px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  color: var(--color-text-primary);
  text-decoration: none;
  font-size: 14px;
  line-height: 18px;
  letter-spacing: -0.28px;
  transition: background 0.2s ease;
}

.nav-link:hover {
  background: var(--color-surface-primary);
}

.nav-link[aria-current="page"] {
  background: var(--color-surface-secondary);
}

.nav-link__icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  background: currentColor;
  mask: var(--icon) center / contain no-repeat;
  -webkit-mask: var(--icon) center / contain no-repeat;
}

.nav-link__emoji {
  display: grid;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  place-items: center;
  font-size: 15px;
}

.nav-link--meta {
  color: var(--color-text-secondary);
  font-size: 12px;
}

.app-stage {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  padding: 8px 8px 8px 0;
}

.tool-layout {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
}

.tool-layout__left {
  display: flex;
  width: 340px;
  flex: 0 0 340px;
  min-height: 0;
}

.tool-form {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
  background: var(--form-bg);
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}

.tool-form__scroll {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: var(--tool-panel-gap);
  padding: 10px 16px 24px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--color-surface-tertiary) transparent;
}

.tool-panel-header {
  display: flex;
  min-height: 32px;
  flex-shrink: 0;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--color-text-primary);
  font-weight: 600;
  font-size: 16px;
  line-height: 20px;
  letter-spacing: -0.32px;
}

.tool-panel-header h1,
.tool-panel-header h2 {
  margin: 0;
  font: inherit;
}

.tool-panel-header__badge {
  height: 20px;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-primary);
  color: var(--color-text-secondary);
  font-weight: 400;
  font-size: 10px;
  line-height: 14px;
  white-space: nowrap;
}

.tool-form__fields {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 16px;
}

.flow-step {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.018);
}

.flow-step__head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--color-text-primary);
  font-size: 13px;
  line-height: 16px;
}

.flow-step__head span {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--color-surface-secondary);
  color: var(--color-text-secondary);
  font-size: 10px;
}

.flow-step__head strong {
  font-weight: 600;
}

.flow-step--summary {
  gap: 8px;
}

.tool-form__intro {
  margin: -8px 0 0;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 16px;
  letter-spacing: -0.24px;
}

.tool-form__submit {
  position: relative;
  flex: 0 0 auto;
  padding: 16px;
}

.tool-form__submit::before {
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 24px;
  background: linear-gradient(to top, var(--form-bg), transparent);
  content: "";
  pointer-events: none;
}

.field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.field > label,
.field > legend {
  padding: 0;
  color: var(--color-text-primary);
  font-size: 14px;
  line-height: 18px;
  letter-spacing: -0.28px;
}

.field > legend.field__meta {
  display: flex;
  width: 100%;
}

.field__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.field__optional,
.hint {
  color: var(--color-text-tertiary);
  font-size: 10px;
  line-height: 13px;
  letter-spacing: -0.2px;
}

.field__optional--error {
  color: #ff6f7d;
}

input[type="text"],
input[type="url"],
textarea,
select {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--color-border-dark);
  border-radius: var(--radius-md);
  outline: none;
  background: var(--color-surface-primary);
  color: var(--color-text-primary);
  font-size: 14px;
  line-height: 18px;
  letter-spacing: -0.28px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

input[type="text"],
input[type="url"],
select {
  height: 44px;
  padding: 0 14px;
}

textarea {
  min-height: 94px;
  padding: 13px 14px;
  resize: vertical;
}

textarea.textarea--large {
  min-height: 156px;
}

input::placeholder,
textarea::placeholder {
  color: var(--color-text-secondary);
  opacity: 1;
}

input:hover,
textarea:hover,
select:hover,
input:focus,
textarea:focus,
select:focus {
  background: var(--color-surface-hover);
}

.upload-zone {
  position: relative;
  display: flex;
  min-height: 108px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  padding: 16px;
  overflow: hidden;
  border: 1px dashed var(--color-surface-tertiary);
  border-radius: var(--radius-lg);
  background: var(--color-surface-primary);
  cursor: pointer;
  transition: background 0.2s ease;
}

.upload-zone:hover {
  background: var(--color-surface-hover);
}

.upload-zone--compact {
  min-height: 92px;
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-zone__glyph {
  position: relative;
  width: 24px;
  height: 24px;
  color: var(--color-text-secondary);
}

.upload-zone__glyph::before,
.upload-zone__glyph::after {
  position: absolute;
  content: "";
}

.upload-zone__glyph::before {
  top: 2px;
  left: 11px;
  width: 1px;
  height: 14px;
  background: currentColor;
}

.upload-zone__glyph::after {
  top: 9px;
  left: 7px;
  width: 8px;
  height: 8px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: rotate(45deg);
}

.upload-zone__label {
  max-width: 100%;
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 14px;
  letter-spacing: -0.24px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-zone__sublabel {
  color: var(--color-text-tertiary);
  font-size: 10px;
  line-height: 12px;
  letter-spacing: -0.2px;
  text-align: center;
}

.segmented {
  display: flex;
  gap: 2px;
  padding: 2px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-secondary);
}

.segmented label {
  position: relative;
  flex: 1;
  cursor: pointer;
}

.segmented input,
.preset input,
.avatar-choice input,
.emoji-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

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

.emoji-choice {
  min-width: 0;
  cursor: pointer;
}

.emoji-choice span {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--color-surface-primary);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.emoji-choice:hover span {
  background: var(--color-surface-secondary);
  transform: translateY(-1px);
}

.emoji-choice b {
  font-size: 28px;
  line-height: 32px;
}

.emoji-choice small {
  max-width: 100%;
  overflow: hidden;
  color: var(--color-text-secondary);
  font-size: 9px;
  line-height: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.emoji-choice input:checked + span {
  border-color: rgba(255, 255, 255, 0.72);
  background: var(--color-surface-tertiary);
}

.emoji-choice input:focus-visible + span {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 2px;
}

.sticker-upload {
  min-height: 154px;
}

.sticker-upload__preview {
  display: grid;
  width: 72px;
  height: 72px;
  place-items: center;
  border-radius: 22px;
  background-color: var(--color-surface-secondary);
  background-position: center;
  background-size: cover;
  box-shadow: inset 0 0 0 1px var(--color-surface-tertiary);
}

.sticker-upload__preview.has-image .upload-zone__glyph {
  display: none;
}

.custom-sticker-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.custom-sticker-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 9px;
  border-radius: var(--radius-md);
  background: var(--color-surface-primary);
}

.custom-sticker-row__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--color-text-secondary);
  font-size: 10px;
  line-height: 13px;
}

.custom-sticker-row__head button {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--color-surface-secondary);
  color: var(--color-text-secondary);
  font-size: 16px;
  cursor: pointer;
}

.custom-sticker-row textarea {
  min-height: 76px;
  background: transparent;
}

.custom-sticker-add {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px dashed var(--color-surface-tertiary);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 11px;
  cursor: pointer;
}

.custom-sticker-add:hover:not(:disabled) {
  background: var(--color-surface-primary);
  color: var(--color-text-primary);
}

.custom-sticker-add:disabled {
  opacity: 0.4;
  cursor: default;
}

.segmented span {
  display: flex;
  min-height: 36px;
  align-items: center;
  justify-content: center;
  padding: 4px 8px;
  border-radius: var(--radius-pill);
  color: var(--color-text-primary);
  font-size: 12px;
  line-height: 14px;
  letter-spacing: -0.24px;
  text-align: center;
  transition: background 0.2s ease;
}

.segmented input:checked + span {
  background: var(--color-surface-card);
}

.source-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preset-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.preset {
  position: relative;
  min-width: 0;
  flex: 1 1 90px;
  cursor: pointer;
}

.preset span {
  display: flex;
  min-height: 34px;
  align-items: center;
  justify-content: center;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-primary);
  color: var(--color-text-secondary);
  font-size: 12px;
  line-height: 14px;
  letter-spacing: -0.24px;
  text-align: center;
  transition: background 0.2s ease, color 0.2s ease;
}

.preset span small {
  display: none;
}

.preset:hover span {
  background: var(--color-surface-secondary);
}

.preset input:checked + span {
  background: var(--color-surface-tertiary);
  color: var(--color-text-primary);
}

.model-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.model-grid .preset span {
  justify-content: flex-start;
  min-height: 44px;
  padding: 8px 12px;
  text-align: left;
}

.model-grid .preset span b {
  font-weight: 400;
}

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

.avatar-choice {
  position: relative;
  cursor: pointer;
}

.avatar-choice img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.12;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  object-fit: cover;
  object-position: top;
  transition: border-color 0.2s ease, opacity 0.2s ease;
}

.avatar-choice:hover img {
  opacity: 0.88;
}

.avatar-choice input:checked + img {
  border-color: rgba(255, 255, 255, 0.96);
}

.avatar-choice input:focus-visible + img {
  outline: 2px solid rgba(255, 255, 255, 0.92);
  outline-offset: 2px;
}

.avatar-grid--ugc .avatar-choice img {
  aspect-ratio: 9 / 16;
}

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

.info-card {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-primary);
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 15px;
  letter-spacing: -0.22px;
}

.info-card strong {
  color: var(--color-text-primary);
  font-weight: 600;
}

.error {
  margin: 0 0 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-negative);
  color: #ff6f7d;
  font-size: 12px;
  line-height: 15px;
}

.generate,
.retry {
  display: flex;
  width: 100%;
  height: 48px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 20px;
  border: 0;
  border-radius: var(--radius-pill);
  background: #fff;
  color: var(--color-text-on-light);
  font-weight: 600;
  font-size: 16px;
  line-height: 20px;
  letter-spacing: -0.32px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.generate:hover:not(:disabled),
.retry:hover {
  opacity: 0.92;
}

.generate:active:not(:disabled),
.retry:active {
  opacity: 0.85;
}

.generate:disabled {
  opacity: 0.4;
  cursor: default;
}

.spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid rgba(8, 8, 8, 0.22);
  border-top-color: rgba(8, 8, 8, 0.88);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.spinner--dark {
  width: 28px;
  height: 28px;
  border-color: var(--color-surface-secondary);
  border-top-color: var(--color-text-primary);
}

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

.tool-layout__right {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  flex-direction: column;
  gap: var(--tool-panel-gap);
  padding: 10px 16px 16px;
  overflow-y: auto;
  border-radius: 0 var(--radius-xl) var(--radius-xl) 0;
  background: var(--color-surface-primary);
  scrollbar-width: thin;
  scrollbar-color: var(--color-surface-tertiary) transparent;
}

.studio-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 28px;
}

.result {
  display: flex;
  min-height: 310px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
}

.empty {
  max-width: 520px;
  margin: auto;
  color: var(--color-text-secondary);
  text-align: center;
}

.empty__icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: var(--radius-lg);
  background: var(--color-surface-primary);
  color: var(--color-text-secondary);
  font-size: 18px;
}

.empty h3 {
  margin: 0 0 8px;
  color: var(--color-text-primary);
  font-family: "SB Sans Display", sans-serif;
  font-size: clamp(25px, 3vw, 32px);
  line-height: 1.1;
  letter-spacing: -0.96px;
}

.empty p {
  max-width: 420px;
  margin: 0 auto;
  font-size: 13px;
  line-height: 17px;
  letter-spacing: -0.26px;
}

.progress-state {
  display: grid;
  width: min(100%, 440px);
  justify-items: center;
  gap: 8px;
}

.job-progress {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 7px;
  margin: 8px 0 4px;
}

.job-progress__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 14px;
  text-align: left;
}

.job-progress__meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-progress__meta strong {
  flex: 0 0 auto;
  color: var(--color-text-primary);
  font-weight: 600;
}

.job-progress__track {
  position: relative;
  width: 100%;
  height: 7px;
  overflow: hidden;
  border-radius: var(--radius-pill);
  background: var(--color-surface-secondary);
}

.job-progress__track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffffff 0%, #a8ffcb 100%);
  transition: width 0.45s ease;
}

.job-progress--indeterminate .job-progress__track span {
  animation: progress-slide 1.2s ease-in-out infinite;
}

@keyframes progress-slide {
  from {
    transform: translateX(-110%);
  }

  to {
    transform: translateX(280%);
  }
}

.result__content {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
  gap: 8px;
}

.result__media {
  position: relative;
  display: flex;
  width: 100%;
  max-height: min(68vh, 768px);
  min-height: 260px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-bg-card);
}

.result video {
  display: block;
  width: 100%;
  max-height: min(68vh, 768px);
  background: #101010;
  object-fit: contain;
}

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

.status {
  display: inline-flex;
  height: 20px;
  align-items: center;
  gap: 6px;
  padding: 3px 7px;
  border-radius: var(--radius-sm);
  background: var(--color-surface-primary);
  color: var(--color-text-secondary);
  font-size: 10px;
  line-height: 14px;
}

.status::before {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--color-text-tertiary);
  content: "";
}

.status[data-state="completed"]::before {
  background: var(--color-status-positive);
}

.status[data-state="uploading"]::before,
.status[data-state="generating"]::before {
  background: #fff600;
}

.status[data-state="failed"]::before {
  background: var(--color-status-negative);
}

.download {
  display: inline-flex;
  height: 32px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 8px 12px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-surface-secondary);
  color: var(--color-text-primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 12px;
  line-height: 14px;
  transition: background 0.2s ease;
}

.download::before {
  width: 13px;
  height: 13px;
  background: currentColor;
  content: "";
  mask: url("/assets/icons/download.svg") center / contain no-repeat;
  -webkit-mask: url("/assets/icons/download.svg") center / contain no-repeat;
}

.download:hover {
  background: var(--color-surface-tertiary);
}

.gallery {
  display: grid;
  width: 100%;
  grid-template-columns: repeat(5, minmax(90px, 1fr));
  gap: 8px;
  overflow-x: auto;
}

.gallery figure {
  position: relative;
  min-width: 0;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-bg-card);
}

.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

body[data-poc="sticker-pack"] .gallery {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

body[data-poc="sticker-pack"] .gallery figure {
  background-color: #25272a;
  background-image:
    linear-gradient(45deg, #2e3034 25%, transparent 25%),
    linear-gradient(-45deg, #2e3034 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #2e3034 75%),
    linear-gradient(-45deg, transparent 75%, #2e3034 75%);
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  background-size: 20px 20px;
}

body[data-poc="sticker-pack"] .gallery img {
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.gallery figcaption {
  position: absolute;
  right: 6px;
  bottom: 6px;
}

.gallery figcaption .download {
  width: 30px;
  padding: 0;
  color: transparent;
  font-size: 0;
  background: rgba(8, 8, 8, 0.64);
}

.gallery figcaption .download::before {
  color: rgba(255, 255, 255, 0.96);
}

.history {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

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

.history h2,
.history h3 {
  margin: 0;
  color: var(--color-text-primary);
  font-weight: 600;
  font-size: 14px;
  line-height: 18px;
  letter-spacing: -0.28px;
}

.history__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(110px, 1fr));
  gap: 10px;
}

.history-card {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
  aspect-ratio: 171 / 228;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-lg);
  background: var(--color-bg-card);
  color: var(--color-text-primary);
  cursor: pointer;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.history-card:hover {
  transform: translateY(-3px);
}

.history-card img,
.history-card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-card__meta {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 30px 9px 8px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.76));
  color: rgba(255, 255, 255, 0.86);
  font-size: 10px;
  line-height: 12px;
  text-align: center;
}

.history-card--empty {
  display: grid;
  min-height: 132px;
  aspect-ratio: auto;
  place-items: center;
  padding: 14px;
  border: 1px dashed var(--color-surface-secondary);
  background: transparent;
  color: var(--color-text-secondary);
  font-size: 11px;
  line-height: 15px;
  text-align: center;
  cursor: default;
}

.history-card--empty:hover {
  transform: none;
}

.history-delete {
  position: absolute;
  top: 6px;
  right: 6px;
  z-index: 2;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(8, 8, 8, 0.72);
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  line-height: 20px;
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 0.2s ease, background 0.2s ease;
}

.history-card:hover .history-delete,
.history-delete:focus-visible {
  opacity: 1;
}

.history-delete:hover {
  background: var(--color-status-negative);
}

@media (max-width: 980px) {
  .sidebar {
    flex-basis: 72px;
    width: 72px;
    padding-inline: 8px;
  }

  .sidebar__logo {
    width: 34px;
    margin-left: 10px;
    overflow: hidden;
  }

  .sidebar__logo img {
    width: 182px;
    max-width: none;
  }

  .sidebar__group-label,
  .nav-link__label,
  .sidebar__bottom {
    display: none;
  }

  .nav-link {
    justify-content: center;
    min-height: 40px;
  }

  .app-stage {
    padding-left: 0;
  }

  .tool-layout__left {
    width: 320px;
    flex-basis: 320px;
  }

  .history__grid {
    grid-template-columns: repeat(3, minmax(100px, 1fr));
  }
}

@media (max-width: 720px) {
  .app-shell {
    position: static;
    min-height: 100vh;
    padding-bottom: 64px;
    overflow: visible;
  }

  .sidebar {
    position: fixed;
    right: 8px;
    bottom: 8px;
    left: 8px;
    z-index: 50;
    display: block;
    width: auto;
    height: 54px;
    padding: 6px;
    border-radius: var(--radius-lg);
    background: rgba(25, 25, 25, 0.96);
    backdrop-filter: blur(20px);
  }

  .sidebar__logo,
  .sidebar__group-label,
  .sidebar__bottom {
    display: none;
  }

  .sidebar__groups,
  .sidebar__list {
    height: 100%;
    overflow: visible;
  }

  .sidebar__list {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
  }

  .nav-link {
    min-height: 42px;
    justify-content: center;
    padding: 6px;
  }

  .nav-link__label {
    display: none;
  }

  .app-stage {
    width: 100%;
    padding: 8px;
  }

  .tool-layout {
    display: block;
    min-height: auto;
  }

  .tool-layout__left {
    width: 100%;
    min-height: auto;
  }

  .tool-form {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  }

  .tool-form__scroll {
    overflow: visible;
  }

  .tool-layout__right {
    min-height: 620px;
    overflow: visible;
    border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  }

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

  .gallery {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
  }

  body[data-poc="sticker-pack"] .gallery {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }
}
