.promo-app {
  background:
    radial-gradient(circle at 64% 0%, rgba(var(--blue-rgb), 0.05), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.active-menu {
  background: var(--blue-soft);
  color: var(--blue-deep) !important;
  font-weight: 800;
}

.toolbar-btn {
  height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  color: #0f172a;
  font-weight: 800;
}

.toolbar-btn svg,
.tab-arrow svg,
.secondary-action svg,
.primary-action svg,
.modal-close svg,
.promo-search svg,
.empty-icon svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.promo-tabbar {
  gap: 8px;
  padding: 0 16px;
}

.tab-arrow {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: #0f172a;
}

.promo-tabbar .tab {
  height: 38px;
  padding: 0 13px;
  background: transparent;
  color: #64748b;
  font-weight: 700;
}

.promo-tabbar .active-tab {
  background: #f1f5fb;
  color: var(--blue-ink);
}

.promo-page {
  min-height: calc(100vh - 131px);
  padding: clamp(30px, 3vw, 38px) clamp(24px, 3vw, 58px) 84px;
}

.promo-shell {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
}

.promo-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 23px;
}

.promo-heading h1 {
  margin: 0;
  color: #0f172a;
  font-size: 32px;
  line-height: 1.1;
  font-weight: 900;
}

.promo-heading p {
  margin: 8px 0 0;
  color: #64748b;
}

.promo-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.promo-stats span {
  min-width: 108px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: #64748b;
  font-weight: 800;
}

.promo-stats strong {
  color: #0f172a;
  font-size: 20px;
}

.filter-card {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
}

.promo-search {
  min-width: 240px;
  flex: 1;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #f8fafc;
  color: #64748b;
  padding: 0 12px;
}

.promo-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #0f172a;
  font: inherit;
}

.filter-card select,
.compose-settings select,
.compose-settings input[type="range"] {
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: #0f172a;
  font: inherit;
  font-weight: 800;
  padding: 0 12px;
}

.filter-card select {
  width: 170px;
}

.primary-action,
.secondary-action {
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  font-weight: 850;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.primary-action:disabled,
.secondary-action:disabled {
  cursor: wait;
  opacity: 0.72;
}

.primary-action {
  border: 1px solid var(--blue);
  background: var(--blue);
  color: #fff;
  box-shadow: 0 10px 20px rgba(var(--blue-rgb), 0.17);
}

.secondary-action {
  border: 1px solid #bfdbfe;
  background: #fff;
  color: var(--blue-ink);
  padding: 0 14px;
}

.empty-card {
  padding: 46px;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
  color: #64748b;
  text-align: center;
  font-weight: 800;
}

.empty-icon {
  width: 62px;
  height: 62px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border-radius: 16px;
  background: #f1f5f9;
  color: #94a3b8;
}

.empty-icon svg {
  width: 34px;
  height: 34px;
}

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

.material-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.material-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #f1f5f9;
}

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

.material-cover video {
  background: #0f172a;
}

.material-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 15px;
}

.material-title {
  margin: 0;
  color: #0f172a;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.material-desc {
  min-height: 38px;
  margin: 5px 0 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

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

.badge {
  height: 24px;
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue-deep);
  font-size: 12px;
  font-weight: 900;
  padding: 0 8px;
}

.badge.neutral {
  background: #f1f5f9;
  color: #475569;
}

.supported-sizes {
  min-height: 72px;
  display: grid;
  gap: 8px;
  align-content: start;
  border-radius: 10px;
  background: #f8fafc;
  padding: 10px;
}

.supported-sizes-label {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.supported-size-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: flex-start;
}

.supported-size-tags span {
  min-height: 24px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  border-radius: 7px;
  background: #eaf2ff;
  color: #1e3a8a;
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  padding: 4px 7px;
}

.material-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
}

.material-actions .primary-action,
.material-actions .secondary-action {
  height: 36px;
  padding: 0 10px;
  box-shadow: none;
  font-size: 12px;
}

.compose-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.34);
}

.compose-dialog {
  width: min(960px, 100%);
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.24);
}

.compose-header,
.compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid #edf1f6;
}

.compose-header h2 {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 900;
}

.compose-header p {
  margin: 7px 0 0;
  color: #64748b;
}

.modal-close {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}

.compose-body {
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
  gap: 20px;
  overflow: auto;
  padding: 22px;
}

.compose-settings {
  display: grid;
  align-content: start;
  gap: 16px;
  min-width: 0;
}

.settings-group {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.compose-settings label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.compose-settings label > span {
  color: #0f172a;
  font-weight: 900;
}

.compose-settings select,
.compose-settings input[type="range"] {
  width: 100%;
  min-width: 0;
}

.compose-settings select {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-preview,
.hint {
  margin: 0;
  color: #64748b;
  font-size: 12px;
  line-height: 1.55;
}

.link-preview {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: normal;
}

.hint {
  word-break: normal;
}

.preview-panel {
  min-height: 320px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #f8fafc;
  padding: 14px;
}

.preview-stage {
  position: relative;
  max-width: 100%;
  max-height: 470px;
  display: grid;
  place-items: center;
  color: #94a3b8;
  cursor: crosshair;
  touch-action: none;
}

.preview-stage.is-static {
  cursor: default;
}

.preview-stage img,
.preview-stage video {
  max-width: 100%;
  max-height: 470px;
  display: block;
  border-radius: 10px;
  user-select: none;
  pointer-events: none;
}

.preview-stage video {
  pointer-events: auto;
  background: #0f172a;
}

.compose-footer {
  display: grid;
  grid-template-columns: minmax(72px, auto) minmax(180px, 1fr);
  align-items: center;
  justify-content: stretch;
  border-top: 1px solid #edf1f6;
  border-bottom: 0;
  background: #fbfdff;
}

.compose-footer .secondary-action {
  min-width: 72px;
  padding-inline: 18px;
}

.compose-footer .primary-action {
  width: 100%;
  min-width: 180px;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
  max-width: 320px;
  padding: 14px 16px;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 18px 48px rgba(15, 23, 42, 0.18);
  font-weight: 800;
}

[hidden] {
  display: none !important;
}

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

@media (max-width: 980px) {
  .promo-heading,
  .compose-body {
    grid-template-columns: 1fr;
  }

  .promo-heading {
    flex-direction: column;
  }

  .promo-stats {
    justify-content: flex-start;
  }

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

@media (max-width: 680px) {
  .filter-card,
  .promo-search,
  .filter-card select,
  .filter-card .secondary-action {
    width: 100%;
  }

  .promo-page {
    padding: 22px 14px 60px;
  }

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

  .compose-backdrop {
    align-items: stretch;
    padding: 10px;
  }

  .compose-dialog {
    max-height: calc(100vh - 20px);
  }

  .compose-header,
  .compose-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .compose-footer {
    display: grid;
    grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
    align-items: center;
  }

  .compose-footer .primary-action {
    min-width: 0;
  }
}
