:root {
  --ep-bg: #f5f6f8;
  --ep-panel: #fff;
  --ep-panel-soft: #f0f2f5;
  --ep-line: rgba(15, 23, 42, .1);
  --ep-text: #10131a;
  --ep-muted: #707785;
  --ep-blue: #2f70f5;
  --ep-blue-soft: rgba(47, 112, 245, .12);
}

html[data-theme="dark"] {
  --ep-bg: #08090b;
  --ep-panel: #111216;
  --ep-panel-soft: #17191e;
  --ep-line: rgba(255, 255, 255, .09);
  --ep-text: #f4f6fa;
  --ep-muted: #858b98;
  --ep-blue: #397bff;
  --ep-blue-soft: rgba(57, 123, 255, .15);
}

.workspace-main.spa-page-editor-projects .workspace-content,
.workspace-main.spa-page-editor-projects #spa-content {
  background: var(--ep-bg);
}

.workspace-sidebar .desktop-upgrade-button .btn,
.workspace-sidebar .mobile-upgrade-button .btn {
  border-color: transparent;
  box-shadow: none;
}

.editor-projects-page {
  width: min(100%, 1700px);
  margin: 0 auto;
  padding: 30px clamp(24px, 4vw, 72px) 72px;
  color: var(--ep-text);
}

.editor-projects-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.editor-projects-title h1 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 7px;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 720;
  letter-spacing: -.025em;
}

.editor-projects-title p {
  margin: 0;
  color: var(--ep-muted);
  font-size: 13px;
}

.editor-projects-beta {
  padding: 3px 7px;
  border-radius: 5px;
  color: #74a3ff;
  background: var(--ep-blue-soft);
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: .08em;
}

.editor-projects-restriction {
  margin-top: 5px;
  color: #f7b955;
  font-size: 12px;
}

.editor-projects-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.editor-projects-search {
  width: min(260px, 24vw);
  height: 40px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ep-muted);
  background: var(--ep-panel);
  border: 1px solid var(--ep-line);
  border-radius: 10px;
}

.editor-projects-search:focus-within {
  border-color: rgba(57, 123, 255, .7);
  box-shadow: 0 0 0 3px rgba(57, 123, 255, .1);
}

.editor-projects-search input {
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--ep-text);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 13px;
}

.editor-projects-search input::placeholder { color: var(--ep-muted); }

.editor-projects-view-toggle {
  height: 40px;
  display: flex;
  align-items: center;
  padding: 3px;
  background: var(--ep-panel);
  border: 1px solid var(--ep-line);
  border-radius: 10px;
}

.editor-projects-view-toggle button {
  height: 32px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 11px;
  color: var(--ep-muted);
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  cursor: pointer;
}

.editor-projects-view-toggle button.is-active {
  color: var(--ep-text);
  background: var(--ep-panel-soft);
}

.editor-projects-new-btn,
.editor-projects-hero-primary {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  color: #fff;
  background: var(--ep-blue);
  border: 0;
  border-radius: 9px;
  box-shadow: 0 8px 22px rgba(47, 112, 245, .22);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
}

.editor-projects-new-btn:hover,
.editor-projects-hero-primary:hover { filter: brightness(1.08); }
.editor-projects-new-btn:disabled,
.editor-projects-hero-primary:disabled { opacity: .55; cursor: wait; }

.editor-projects-subtoolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 17px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--ep-line);
}

.editor-projects-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.editor-projects-filters button {
  height: 34px;
  padding: 0 12px;
  color: var(--ep-muted);
  background: transparent;
  border: 1px solid var(--ep-line);
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
}

.editor-projects-filters button span { margin-left: 4px; opacity: .7; }
.editor-projects-filters button.is-active {
  color: #7ca9ff;
  background: var(--ep-blue-soft);
  border-color: rgba(57, 123, 255, .45);
}

.editor-projects-sort {
  height: 34px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  color: var(--ep-muted);
  border: 1px solid var(--ep-line);
  border-radius: 8px;
  font-size: 12px;
}

.editor-projects-sort select {
  max-width: 120px;
  padding: 0 15px 0 0;
  color: var(--ep-text);
  background: transparent;
  border: 0;
  outline: 0;
  appearance: none;
  font: inherit;
}

.editor-projects-sort i { margin-left: -13px; font-size: 9px; pointer-events: none; }

.editor-projects-hero {
  min-height: 286px;
  margin-top: 28px;
  padding: 42px clamp(32px, 4vw, 58px);
  display: grid;
  grid-template-columns: minmax(330px, .8fr) minmax(480px, 1.2fr);
  align-items: center;
  gap: 46px;
  overflow: hidden;
  position: relative;
  border: 1px solid rgba(90, 119, 177, .2);
  border-radius: 22px;
  background:
    radial-gradient(circle at 8% 20%, rgba(39, 91, 208, .16), transparent 34%),
    radial-gradient(circle at 75% 40%, rgba(43, 78, 157, .12), transparent 42%),
    radial-gradient(circle, rgba(91, 129, 206, .12) 1px, transparent 1.4px),
    #0c0e14;
  background-size: auto, auto, 25px 25px, auto;
  color: #f5f7fb;
}

.editor-projects-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, transparent 55%, rgba(4, 6, 10, .35));
}

.editor-projects-hero-copy,
.editor-projects-hero-flow { position: relative; z-index: 1; }

.editor-projects-eyebrow {
  display: block;
  margin-bottom: 13px;
  color: #6897ed;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .2em;
}

.editor-projects-hero h2 {
  max-width: 420px;
  margin: 0;
  white-space: pre-line;
  font-size: clamp(32px, 3vw, 48px);
  line-height: .98;
  font-weight: 760;
  letter-spacing: -.05em;
}

.editor-projects-hero-copy > p {
  max-width: 550px;
  margin: 18px 0 0;
  color: #858d9d;
  font-size: 14px;
  line-height: 1.75;
}

.editor-projects-hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.editor-projects-hero-secondary {
  min-height: 40px;
  padding: 0 17px;
  color: #c6cad2;
  background: rgba(255, 255, 255, .035);
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 9px;
  font-size: 13px;
  cursor: pointer;
}

.editor-projects-hero-secondary:hover { background: rgba(255, 255, 255, .08); }

.editor-projects-hero-flow {
  min-height: 180px;
  display: grid;
  grid-template-columns: 120px 62px 170px 62px 140px;
  align-items: center;
  justify-content: end;
}

.editor-projects-flow-node {
  height: 132px;
  display: flex;
  align-items: flex-end;
  padding: 12px;
  color: #71798b;
  border: 1px solid rgba(139, 158, 198, .28);
  border-radius: 14px;
  background: repeating-linear-gradient(135deg, rgba(110, 130, 175, .07) 0 2px, transparent 2px 10px), rgba(5, 7, 12, .55);
  font: 10px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.editor-projects-flow-node--main {
  height: 156px;
  border-color: rgba(66, 121, 245, .7);
  box-shadow: 0 0 0 4px rgba(42, 88, 190, .16);
}

.editor-projects-flow-node--small { height: 72px; }
.editor-projects-flow-stack { display: grid; gap: 14px; }

.editor-projects-flow-line {
  height: 1px;
  margin: 0 15px;
  background: linear-gradient(90deg, rgba(56, 103, 205, .35), rgba(83, 132, 240, .8), rgba(56, 103, 205, .35));
}

.editor-projects-picks,
.editor-projects-recents { margin-top: 34px; }

.editor-projects-section-heading {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 14px;
}

.editor-projects-section-heading h2 {
  margin: 0;
  color: var(--ep-text);
  font-size: 16px;
  font-weight: 680;
}

.editor-projects-section-heading p,
.editor-projects-section-heading > span {
  margin: 0;
  color: var(--ep-muted);
  font-size: 12px;
}

.editor-projects-section-heading--recent::after {
  content: "";
  height: 1px;
  flex: 1;
  margin-left: 4px;
  background: var(--ep-line);
}

.editor-projects-picks-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.editor-projects-pick-card {
  min-width: 0;
  overflow: hidden;
  color: var(--ep-text);
  background: var(--ep-panel);
  border: 1px solid var(--ep-line);
  border-radius: 14px;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.editor-projects-pick-card:hover {
  transform: translateY(-2px);
  border-color: rgba(83, 132, 240, .42);
}

.editor-projects-pick-preview {
  height: 148px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, #18243c, #0e1420);
}

.editor-projects-pick-preview::after,
.editor-project-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(135deg, rgba(255, 255, 255, .045) 0 2px, transparent 2px 11px);
}

.editor-projects-pick-preview img {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 1;
  object-fit: cover;
}

.editor-projects-pick-badge {
  position: absolute;
  z-index: 2;
  left: 10px;
  bottom: 10px;
  padding: 5px 8px;
  color: rgba(242, 246, 255, .92);
  background: rgba(7, 11, 20, .72);
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 7px;
  font-size: 10px;
  font-weight: 650;
  backdrop-filter: blur(8px);
}

.editor-projects-pick-body {
  min-height: 66px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 13px 14px;
}

.editor-projects-pick-body strong {
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.editor-projects-pick-body small {
  overflow: hidden;
  color: var(--ep-muted);
  font-size: 11px;
  line-height: 1.4;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.editor-projects-pick-card.skeleton {
  height: 232px;
  background: linear-gradient(110deg, var(--ep-panel) 12%, var(--ep-panel-soft) 30%, var(--ep-panel) 48%);
  background-size: 220% 100%;
  animation: editorProjectsShimmer 1.2s ease-in-out infinite;
}

.editor-projects-picks-empty {
  grid-column: 1 / -1;
  padding: 30px 18px;
  color: var(--ep-muted);
  background: var(--ep-panel);
  border: 1px dashed var(--ep-line);
  border-radius: 14px;
  text-align: center;
  font-size: 12px;
}

.editor-projects-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(190px, 1fr));
  gap: 16px;
  min-height: 190px;
}

.editor-project-card {
  min-width: 0;
  overflow: hidden;
  position: relative;
  color: var(--ep-text);
  background: var(--ep-panel);
  border: 1px solid var(--ep-line);
  border-radius: 15px;
  transition: transform .16s ease, border-color .16s ease;
}

.editor-project-card:hover {
  transform: translateY(-2px);
  border-color: rgba(83, 132, 240, .42);
}

.editor-project-card-link {
  height: 100%;
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}

.editor-project-thumb {
  height: 148px;
  overflow: hidden;
  position: relative;
  background: linear-gradient(135deg, hsl(var(--project-hue, 215) 45% 23%), hsl(calc(var(--project-hue, 215) + 30) 38% 13%));
}

.editor-project-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  position: relative;
  z-index: 1;
  object-fit: cover;
}

.editor-project-thumb-label {
  position: absolute;
  z-index: 2;
  left: 12px;
  bottom: 10px;
  color: rgba(255, 255, 255, .42);
  font: 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace;
}

.editor-project-badges {
  position: absolute;
  z-index: 3;
  top: 9px;
  left: 9px;
  display: flex;
  gap: 5px;
}

.editor-project-badges span {
  padding: 4px 7px;
  color: rgba(255, 255, 255, .86);
  background: rgba(3, 5, 9, .72);
  border-radius: 5px;
  font-size: 10px;
}

.editor-project-meta {
  min-height: 82px;
  padding: 13px 13px 15px;
}

.editor-project-meta-title {
  overflow: hidden;
  color: var(--ep-text);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.editor-project-meta-detail {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  color: var(--ep-muted);
  font-size: 11px;
}

.editor-project-meta-detail span + span::before {
  content: "·";
  margin-right: 7px;
}

.editor-project-new-card {
  min-height: 232px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-style: dashed;
  background: transparent;
  cursor: pointer;
}

.editor-project-new-card-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  color: var(--ep-muted);
  font-size: 12px;
}

.editor-project-new-card-inner b {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: var(--ep-text);
  border: 1px solid var(--ep-line);
  border-radius: 10px;
  font-size: 22px;
  font-weight: 350;
}

.editor-project-card-menu {
  position: absolute;
  z-index: 5;
  top: 8px;
  right: 8px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}

.editor-project-card:hover .editor-project-card-menu,
.editor-project-card:focus-within .editor-project-card-menu {
  opacity: 1;
  pointer-events: auto;
}

.editor-project-menu-trigger {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(5, 7, 12, .7);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.editor-project-menu-popover {
  width: 138px;
  display: grid;
  gap: 3px;
  position: absolute;
  top: 36px;
  right: 0;
  padding: 6px;
  background: #181a20;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
}

.editor-project-menu-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  color: #d8dce5;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 12px;
  text-align: left;
  cursor: pointer;
}

.editor-project-menu-item:hover { background: rgba(255, 255, 255, .08); }
.editor-project-menu-item--danger { color: #ff7b7b; }
.editor-project-menu-item:disabled { opacity: .5; cursor: wait; }

.editor-projects-grid.is-list-view {
  grid-template-columns: 1fr;
  gap: 8px;
}

.editor-projects-grid.is-list-view .editor-project-card { min-height: 76px; }
.editor-projects-grid.is-list-view .editor-project-card-link { flex-direction: row; align-items: center; }
.editor-projects-grid.is-list-view .editor-project-thumb { width: 118px; height: 74px; flex: 0 0 118px; }
.editor-projects-grid.is-list-view .editor-project-meta { min-height: 0; flex: 1; padding: 13px 52px 13px 16px; }
.editor-projects-grid.is-list-view .editor-project-new-card { min-height: 76px; justify-content: flex-start; padding-left: 25px; }
.editor-projects-grid.is-list-view .editor-project-new-card-inner { flex-direction: row; }
.editor-projects-grid.is-list-view .editor-project-thumb-label { display: none; }

.editor-projects-empty { padding: 24px 0; }
.editor-projects-empty-card {
  min-height: 160px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ep-muted);
  border: 1px dashed var(--ep-line);
  border-radius: 14px;
}
.editor-projects-empty-title { color: var(--ep-text); font-size: 14px; font-weight: 650; }
.editor-projects-empty-subtitle { font-size: 12px; }
.editor-projects-empty-card button {
  margin-top: 6px;
  padding: 8px 12px;
  color: #7ca9ff;
  background: var(--ep-blue-soft);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.editor-projects-skeleton { display: contents; }
.editor-project-card.skeleton {
  height: 232px;
  background: linear-gradient(110deg, var(--ep-panel) 12%, var(--ep-panel-soft) 30%, var(--ep-panel) 48%);
  background-size: 220% 100%;
  animation: editorProjectsShimmer 1.2s ease-in-out infinite;
}

@keyframes editorProjectsShimmer {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

@media (hover: none), (pointer: coarse) {
  .editor-project-card-menu { opacity: 1; pointer-events: auto; }
}

@media (max-width: 1280px) {
  .editor-projects-picks-grid,
  .editor-projects-grid { grid-template-columns: repeat(4, minmax(180px, 1fr)); }
  .editor-projects-hero { grid-template-columns: minmax(300px, .8fr) minmax(400px, 1.2fr); }
  .editor-projects-hero-flow { transform: scale(.88); transform-origin: right center; }
}

@media (max-width: 980px) {
  .editor-projects-header { flex-direction: column; }
  .editor-projects-toolbar { width: 100%; }
  .editor-projects-search { width: auto; flex: 1; }
  .editor-projects-hero { grid-template-columns: 1fr; }
  .editor-projects-hero-flow { display: none; }
  .editor-projects-hero-copy { max-width: 650px; }
  .editor-projects-picks-grid,
  .editor-projects-grid { grid-template-columns: repeat(3, minmax(160px, 1fr)); }
}

@media (max-width: 680px) {
  .editor-projects-page { padding: 20px 16px 52px; }
  .editor-projects-title h1 { font-size: 23px; }
  .editor-projects-toolbar { display: grid; grid-template-columns: 1fr auto; }
  .editor-projects-search { grid-column: 1 / -1; width: 100%; }
  .editor-projects-view-toggle span { display: none; }
  .editor-projects-new-btn { min-width: 132px; }
  .editor-projects-subtoolbar { align-items: flex-start; }
  .editor-projects-filters { max-width: calc(100vw - 132px); overflow-x: auto; padding-bottom: 2px; }
  .editor-projects-filters button { flex: 0 0 auto; }
  .editor-projects-sort > span { display: none; }
  .editor-projects-sort select { width: 102px; }
  .editor-projects-hero { min-height: 285px; padding: 34px 25px; border-radius: 17px; }
  .editor-projects-hero h2 { font-size: 36px; }
  .editor-projects-hero-actions { align-items: stretch; flex-direction: column; }
  .editor-projects-hero-actions button { width: 100%; }
  .editor-projects-section-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .editor-projects-section-heading--recent { flex-direction: row; align-items: center; }
  .editor-projects-picks-grid {
    display: flex;
    margin-right: -16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .editor-projects-picks-grid::-webkit-scrollbar { display: none; }
  .editor-projects-pick-card {
    min-width: min(76vw, 270px);
    display: block;
    scroll-snap-align: start;
  }
  .editor-projects-picks-empty { min-width: calc(100vw - 32px); }
  .editor-projects-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .editor-project-thumb { height: 118px; }
  .editor-project-meta { min-height: 78px; padding: 11px; }
  .editor-project-new-card { min-height: 198px; }
  .editor-projects-grid.is-list-view { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .editor-projects-grid:not(.is-list-view) { grid-template-columns: 1fr; }
  .editor-projects-grid:not(.is-list-view) .editor-project-thumb { height: 180px; }
  .editor-project-new-card { min-height: 160px; }
}
