:root {
  --pixplet-bg: #f5f7fb;
  --pixplet-panel: #ffffff;
  --pixplet-soft: #f7f9fc;
  --pixplet-text: #0f172a;
  --pixplet-muted: #64748b;
  --pixplet-line: #e2e8f0;
  --pixplet-accent: #5b6cff;
  --pixplet-accent-2: #27b8ff;
  --pixplet-radius: 22px;
  --pixplet-shadow: 0 18px 55px rgba(15, 23, 42, 0.08);
}

.pixplet-admin-wrap {
  margin: 20px 20px 0 0;
}

.pixplet-admin-wrap *,
.pixplet-admin-wrap *::before,
.pixplet-admin-wrap *::after,
.pixplet-sidebar *,
.pixplet-sidebar *::before,
.pixplet-sidebar *::after {
  box-sizing: border-box;
}

.pixplet-shell,
.pixplet-sidebar {
  color: var(--pixplet-text);
}

.pixplet-hero,
.pixplet-panel,
.pixplet-modal__dialog,
.pixplet-sidebar {
  background: var(--pixplet-panel);
  border: 1px solid var(--pixplet-line);
  border-radius: var(--pixplet-radius);
  box-shadow: var(--pixplet-shadow);
}

.pixplet-hero {
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 24px;
  padding: 28px;
  margin-bottom: 24px;
  background:
    radial-gradient(circle at top right, rgba(91,108,255,.14), transparent 32%),
    radial-gradient(circle at bottom left, rgba(39,184,255,.12), transparent 28%),
    #fff;
}

.pixplet-modal__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef2ff;
  color: #4338ca;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.pixplet-hero h1 {
  margin: 14px 0 10px;
  font-size: 46px;
  line-height: 1.02;
}

.pixplet-hero p,
.pixplet-card__body p,
.pixplet-empty,
.pixplet-statusbar,
.pixplet-modal__header p,
.pixplet-sidebar__text,
.pixplet-sidebar__hint,
.pixplet-sidebar-empty {
  color: var(--pixplet-muted);
}


.pixplet-hero__mini {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  min-height: 220px;
}

.pixplet-hero__mini span {
  border-radius: 24px;
  min-height: 96px;
  display: block;
  border: 1px solid rgba(91,108,255,.16);
  background: linear-gradient(135deg, rgba(91,108,255,.18), rgba(39,184,255,.18));
}

.pixplet-hero__mini span:nth-child(2),
.pixplet-hero__mini span:nth-child(3) {
  background: linear-gradient(135deg, rgba(15,23,42,.02), rgba(15,23,42,.06));
  border-color: rgba(15,23,42,.06);
}

.pixplet-panel {
  padding: 24px;
}

.pixplet-toolbar,
.pixplet-statusbar,
.pixplet-modal__header,
.pixplet-modal__stickybar,
.pixplet-sidebar__searchrow,
.pixplet-sidebar__searchstack {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.pixplet-toolbar,
.pixplet-statusbar {
  margin-bottom: 18px;
}

.pixplet-toolbar {
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr);
  align-items: end;
}

.pixplet-toolbar__left,
.pixplet-toolbar__right {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: nowrap;
}

.pixplet-toolbar__right {
  min-width: 0;
}

.pixplet-field {
  min-width: 180px;
}

.pixplet-field span,
.pixplet-meta-form label span {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--pixplet-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-weight: 700;
}

.pixplet-field select,
.pixplet-search input,
.pixplet-meta-form input,
.pixplet-meta-form textarea,
.pixplet-sidebar-search {
  width: 100%;
  min-height: 46px;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--pixplet-line);
  border-radius: 14px;
  color: var(--pixplet-text);
}

.pixplet-search {
  flex: 1 1 auto;
  min-width: 0;
}

.pixplet-search input {
  min-width: 0;
}

.pixplet-button-primary,
.pixplet-button-secondary,
.pixplet-sidebar-button {
  min-height: 46px !important;
  padding: 0 18px !important;
  border-radius: 14px !important;
  box-shadow: none !important;
  font-weight: 700 !important;
}

.pixplet-button-primary {
  color: #fff !important;
  border-color: transparent !important;
  background: linear-gradient(135deg, var(--pixplet-accent), var(--pixplet-accent-2)) !important;
}

.pixplet-button-secondary,
.pixplet-sidebar-button {
  color: var(--pixplet-text) !important;
  border: 1px solid var(--pixplet-line) !important;
  background: #fff !important;
}

.pixplet-statusbar {
  padding: 12px 14px;
  background: var(--pixplet-soft);
  border: 1px solid var(--pixplet-line);
  border-radius: 16px;
}

.pixplet-link-button,
.pixplet-external-link {
  background: transparent;
  border: 0;
  padding: 0;
  color: #2563eb;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.pixplet-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
}

.pixplet-card {
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--pixplet-line);
  background: #fff;
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.pixplet-card:hover {
  transform: translateY(-3px);
  border-color: #c7d2fe;
  box-shadow: 0 18px 40px rgba(15,23,42,.08);
}

.pixplet-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #eef2f7;
}

.pixplet-card__media img,
.pixplet-modal__media img,
.pixplet-sidebar-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pixplet-card__tag {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  background: rgba(15,23,42,.72);
  backdrop-filter: blur(8px);
}

.pixplet-card__body {
  padding: 16px;
}

.pixplet-card__body h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.25;
}

.pixplet-card__body p {
  margin: 0;
  font-size: 14px;
  min-height: 36px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pixplet-card--skeleton {
  min-height: 310px;
  background: linear-gradient(90deg, #f8fafc, #eef2f7, #f8fafc);
  background-size: 200% 100%;
  animation: pixplet-shimmer 1.2s linear infinite;
}

.pixplet-card--skeleton span {
  display: block;
  width: 100%;
  height: 100%;
}

.pixplet-empty,
.pixplet-loadmore-wrap {
  margin-top: 22px;
  text-align: center;
}

.pixplet-modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
}

.pixplet-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .55);
  backdrop-filter: blur(6px);
}

.pixplet-modal__dialog {
  position: relative;
  z-index: 1;
  width: min(1200px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  margin: 24px auto;
}

.pixplet-modal__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(380px, .9fr);
}

.pixplet-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 100;
  pointer-events: auto;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.5);
  background: rgba(255,255,255,.85);
  cursor: pointer;
  font-size: 24px;
}

.pixplet-modal__media {
  min-height: 560px;
  background: #f1f5f9;
}

.pixplet-modal__media img {
  image-rendering: auto;
}

.pixplet-modal__content {
  display: flex;
  flex-direction: column;
  padding: 28px;
  overflow-y: auto;
  max-height: calc(100vh - 48px);
}

.pixplet-modal__header {
  align-items: flex-start;
  margin-bottom: 18px;
}

.pixplet-modal__header h3 {
  margin: 12px 0 8px;
  font-size: 30px;
  line-height: 1.1;
}

.pixplet-modal__header p {
  margin: 0;
  font-size: 15px;
}

.pixplet-meta-form {
  display: grid;
  gap: 14px;
  margin: 6px 0 18px;
}

.pixplet-meta-form input::placeholder,
.pixplet-meta-form textarea::placeholder {
  color: #94a3b8;
}

.pixplet-modal__stickybar {
  position: sticky;
  bottom: -28px;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 0 12px;
  margin-top: auto;
  background: linear-gradient(180deg, rgba(255,255,255,0), rgba(255,255,255,.96) 32%, #fff 56%);
}

.pixplet-modal__stickybar .button {
  width: 100%;
  min-width: 0;
  text-align: center;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

.pixplet-modal__upsell {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--pixplet-muted);
}

.pixplet-modal__upsell strong {
  color: var(--pixplet-text);
}

.pixplet-preview-loading,
.pixplet-sidebar-loading {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 300px;
  color: var(--pixplet-muted);
}

.pixplet-toast {
  margin: 12px 0 0;
  padding: 12px 14px;
  border-radius: 14px;
  color: #166534;
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
}

.pixplet-toast.is-error {
  color: #b91c1c;
  border-color: #fecaca;
  background: #fef2f2;
}

.pixplet-toast a {
  margin-left: 8px;
  color: inherit;
  font-weight: 700;
}

body.pixplet-modal-open {
  overflow: hidden;
}

.pixplet-sidebar {
  padding: 0;
  box-shadow: none;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.pixplet-sidebar__notice {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(91,108,255,.09), rgba(39,184,255,.08));
  border: 1px solid #dbe4ff;
  color: #1e293b;
  font-weight: 700;
  line-height: 1.45;
}

.pixplet-sidebar__text,
.pixplet-sidebar__hint {
  font-size: 13px;
  margin: 0 0 12px;
}

.pixplet-sidebar__searchstack {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 12px;
}

.pixplet-sidebar-search,
.pixplet-sidebar-button {
  width: 100%;
}

.pixplet-sidebar-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
  margin-top: 12px;
}

.pixplet-sidebar-card {
  overflow: hidden;
  text-align: left;
  border-radius: 14px;
  border: 1px solid var(--pixplet-line);
  background: #fff;
  cursor: pointer;
  padding: 0;
  display: block;
  min-height: 0;
}

.pixplet-sidebar-card img {
  aspect-ratio: 16 / 9;
  height: auto;
}

.pixplet-button-primary:hover,
.pixplet-button-primary:focus {
  filter: brightness(1.03);
}

.pixplet-button-secondary:hover,
.pixplet-button-secondary:focus,
.pixplet-sidebar-button:hover,
.pixplet-sidebar-button:focus {
  border-color: #c7d2fe !important;
  background: #f8faff !important;
}

@keyframes pixplet-shimmer {
  from { background-position: 200% 0; }
  to { background-position: -200% 0; }
}

@media (max-width: 1100px) {
  .pixplet-hero,
  .pixplet-modal__layout {
    grid-template-columns: 1fr;
  }

  .pixplet-modal__media {
    min-height: 340px;
  }
}

@media (max-width: 782px) {
  .pixplet-sidebar-card {
    min-height: 0;
  }

  .pixplet-admin-wrap {
    margin-right: 10px;
  }

  .pixplet-hero,
  .pixplet-panel,
  .pixplet-modal__content,
  .pixplet-sidebar {
    padding: 18px;
  }

  .pixplet-hero h1 {
    font-size: 34px;
  }


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

  .pixplet-modal__dialog {
    width: calc(100vw - 20px);
    margin: 10px auto;
    max-height: calc(100vh - 20px);
  }

  .pixplet-modal__content {
    max-height: none;
  }

  .pixplet-toolbar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .pixplet-toolbar__left,
  .pixplet-toolbar__right {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
  }

  .pixplet-field,
  .pixplet-search,
  .pixplet-search input,
  #pixplet-category,
  #pixplet-search-button {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .pixplet-modal__stickybar {
    grid-template-columns: 1fr 1fr;
  }

  .pixplet-modal__stickybar .button,
  .pixplet-sidebar-search,
  .pixplet-sidebar-button {
    width: 100%;
  }
}
