.psd-conflict-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 24px;
}

.psd-conflict-overlay[hidden] {
  display: none;
}

.psd-conflict-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 24, 39, 0.42);
  backdrop-filter: blur(3px);
}

.psd-conflict-panel {
  position: relative;
  width: min(520px, calc(100vw - 48px));
  padding: 24px;
  border: 1px solid #e8edf5;
  border-radius: var(--rect-radius, 8px);
  background: #fff;
  box-shadow: 0 24px 80px rgba(17, 24, 39, 0.2);
}

.psd-conflict-head {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
}

.psd-conflict-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #cd140f;
  background: #fff2f0;
  font-weight: 800;
}

.psd-conflict-head h3,
.psd-conflict-head p,
.psd-conflict-detail {
  margin: 0;
}

.psd-conflict-head h3 {
  color: #111827;
  font-size: 18px;
  line-height: 1.35;
}

.psd-conflict-head p,
.psd-conflict-detail {
  color: #667085;
  font-size: 13px;
  line-height: 1.65;
}

.psd-conflict-head p {
  margin-top: 4px;
}

.psd-conflict-detail {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: var(--rect-radius, 8px);
  background: #f7fbff;
}

.psd-conflict-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.psd-conflict-button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid #00afe9;
  border-radius: var(--rect-radius, 8px);
  color: #00afe9;
  background: #fff;
  font-weight: 700;
}

.psd-conflict-button.is-danger {
  border-color: #cd140f;
  color: #fff;
  background: #cd140f;
}

.psd-conflict-button.is-quiet {
  border-color: #e8edf5;
  color: #667085;
}

.layout-layer-export-button.is-primary {
  border-color: #00afe9;
  color: #fff;
  background: #00afe9;
}

#psdLayerProjectsRoot {
  --psd-brand: #00afe9;
  --psd-danger: #cd140f;
  --psd-success: #03b144;
  --psd-border: #e2eaf2;
  --psd-muted: #6b7788;
  width: 100%;
  height: calc(100dvh - 60px);
  min-height: 720px;
  overflow: hidden;
  color: #1c2738;
  background: #f5faff;
}

.view[data-view="layout"] .layout-view:has(#psdLayerProjectsRoot) {
  display: block;
  min-height: 0;
}

.view[data-view="layout"] .layout-view:has(#psdLayerProjectsRoot) > :not(#psdLayerProjectsRoot) {
  display: none !important;
}

.workspace:has(.view[data-view="layout"].is-active) .view-stage {
  padding: 0;
  overflow: hidden;
}

.psd-projects-page {
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) 36px;
  padding: 16px 20px 18px;
  box-sizing: border-box;
}

.psd-projects-grid,
.psd-projects-statusbar {
  min-width: 0;
}

.psd-browser-heading,
.psd-browser-nav,
.psd-stage-head,
.psd-stage-footer,
.psd-inspector-tabs,
.psd-inspector-footer,
.psd-layer-row,
.psd-layer-actions,
.psd-projects-statusbar {
  display: flex;
  align-items: center;
}

.psd-browser-tab,
.psd-layer-action,
.psd-layer-visibility,
.psd-version-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--rect-radius, 8px);
  font: inherit;
}

.psd-projects-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 400px;
  overflow: hidden;
  border: 1px solid var(--psd-border);
  border-radius: var(--rect-radius, 8px) var(--rect-radius, 8px) 0 0;
  background: #fff;
}

.psd-projects-browser,
.psd-projects-inspector,
.psd-projects-stage {
  min-width: 0;
  min-height: 0;
}

.psd-projects-browser,
.psd-projects-inspector {
  display: grid;
  overflow: hidden;
  background: #fff;
}

.psd-projects-browser {
  grid-template-rows: 48px 42px 58px minmax(0, 1fr);
  border-right: 1px solid var(--psd-border);
}

.psd-browser-heading {
  justify-content: space-between;
  padding: 0 16px;
  border-bottom: 1px solid var(--psd-border);
  font-size: 14px;
}

.psd-browser-heading span {
  color: var(--psd-muted);
  font-size: 12px;
}

.psd-browser-nav {
  padding: 6px 12px 0;
  gap: 4px;
}

.psd-browser-tab {
  flex: 1;
  height: 32px;
  border: 0;
  color: var(--psd-muted);
  background: transparent;
  font-size: 12px;
  font-weight: 600;
}

.psd-browser-tab.is-active {
  color: var(--psd-brand);
  background: #eaf9fe;
}

.psd-project-search {
  height: 40px;
  margin: 8px 16px 10px;
  padding: 0 12px;
  border: 1px solid var(--psd-border);
  border-radius: var(--rect-radius, 8px);
  outline: 0;
  color: #253247;
  background: #fff;
  font: inherit;
  font-size: 12px;
}

.psd-project-search:focus {
  border-color: var(--psd-brand);
  box-shadow: 0 0 0 3px rgba(0, 175, 233, 0.1);
}

.psd-project-list,
.psd-inspector-content,
.psd-layer-list,
.psd-version-list {
  min-height: 0;
  overflow: auto;
}

.psd-project-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.psd-project-card {
  width: 100%;
  min-height: 104px;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin: 0;
  padding: 16px;
  border: 1px solid var(--psd-border);
  border-radius: var(--rect-radius, 8px);
  color: #344054;
  background: #fff;
  text-align: left;
}

.psd-project-card:hover {
  border-color: #b9e8f8;
  background: #f7fbff;
}

.psd-project-card.is-active {
  border-color: #5cc8f4;
  background: #f2fbfe;
}

.psd-project-thumb {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1px solid #aee5f7;
  border-radius: var(--rect-radius, 8px);
  color: var(--psd-brand);
  background: linear-gradient(145deg, #e7f8fe, #c9f0fb);
  font-size: 24px;
}

.psd-project-card-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.psd-project-title,
.psd-project-meta,
.psd-project-state {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.psd-project-title {
  color: #111827;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
}

.psd-project-meta {
  color: var(--psd-muted);
  font-size: 12px;
  line-height: 18px;
}

.psd-project-state {
  width: fit-content;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid #b9e8f8;
  border-radius: 999px;
  color: #344054;
  background: #fff;
  font-size: 12px;
  line-height: 1;
}

.psd-project-state.is-synced {
  color: var(--psd-success);
  border-color: #a7e4bf;
}

.psd-project-state.is-failed {
  color: var(--psd-danger);
  border-color: #f0c5c3;
}

.psd-projects-stage {
  display: grid;
  grid-template-rows: 48px minmax(0, 1fr) 36px;
  overflow: hidden;
  background: #f1f8fc;
}

.psd-stage-head,
.psd-stage-footer {
  justify-content: space-between;
  gap: 20px;
  padding: 0 16px;
  border-bottom: 1px solid var(--psd-border);
  color: #5e6b7d;
  background: rgba(255, 255, 255, 0.94);
  font-size: 12px;
}

.psd-stage-footer {
  border-top: 1px solid var(--psd-border);
  border-bottom: 0;
}

.psd-stage-body {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 32px;
  background-color: #f2f8fc;
  background-image:
    linear-gradient(rgba(120, 160, 184, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120, 160, 184, 0.09) 1px, transparent 1px);
  background-size: 20px 20px;
}

.psd-stage-empty {
  color: var(--psd-muted);
  font-size: 14px;
}

.psd-artboard {
  position: relative;
  width: min(90%, 1320px);
  max-height: 86%;
  overflow: hidden;
  border: 1px solid #d8e3ec;
  border-radius: var(--rect-radius, 8px);
  background: #fff;
  box-shadow: 0 18px 50px rgba(47, 80, 105, 0.14);
}

.psd-artboard-layer {
  position: absolute;
  overflow: hidden;
  padding: 0;
  border: 0;
  color: #172134;
  background: transparent;
  transform-origin: center;
}

.psd-artboard-layer.is-selected {
  box-shadow: inset 0 0 0 1px var(--psd-brand);
}

.psd-artboard-layer img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.psd-artboard-layer.is-text {
  display: flex !important;
  align-items: center;
  font-size: clamp(12px, 1.4vw, 28px);
  font-weight: 600;
  text-align: left;
}

.psd-projects-inspector {
  grid-template-rows: 48px minmax(0, 1fr) 76px;
  border-left: 1px solid var(--psd-border);
}

.psd-inspector-tabs {
  border-bottom: 1px solid var(--psd-border);
}

.psd-inspector-tabs button {
  position: relative;
  flex: 1;
  height: 48px;
  border: 0;
  color: var(--psd-muted);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}

.psd-inspector-tabs button.is-active {
  color: var(--psd-brand);
}

.psd-inspector-tabs button.is-active::after {
  content: "";
  position: absolute;
  right: 20px;
  bottom: 0;
  left: 20px;
  height: 2px;
  background: var(--psd-brand);
}

.psd-inspector-content {
  padding: 0;
}

.psd-inspector-footer {
  padding: 16px;
  border-top: 1px solid var(--psd-border);
  background: #fff;
}

.psd-inspector-export {
  width: 100%;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--psd-brand);
  border-radius: var(--rect-radius, 8px);
  color: #fff;
  background: linear-gradient(90deg, var(--psd-brand) 0%, #5cc8f4 100%);
  box-shadow: 0 4px 12px rgba(0, 175, 233, 0.18);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

.psd-inspector-export:hover:not(:disabled) {
  filter: brightness(0.98);
}

.psd-inspector-export:active:not(:disabled) {
  transform: translateY(1px);
}

.psd-inspector-export:focus-visible {
  outline: 3px solid rgba(0, 175, 233, 0.2);
  outline-offset: 2px;
}

.psd-inspector-export:disabled,
.psd-layer-action:disabled {
  border-color: #d8e1ea;
  color: #98a2b3;
  background: #f2f4f7;
  box-shadow: none;
  opacity: 0.72;
  cursor: not-allowed;
}

.psd-layer-list {
  display: grid;
  align-content: start;
  padding: 16px;
  gap: 12px;
}

.psd-layer-row {
  min-height: 72px;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--psd-border);
  border-radius: var(--rect-radius, 8px);
  color: #344054;
  background: #fff;
}

.psd-layer-row:hover {
  border-color: #b9e8f8;
}

.psd-layer-row.is-active {
  border-color: #5cc8f4;
  background: #e7f8fe;
}

.psd-layer-visibility {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  color: #8793a3;
  background: transparent;
  font-size: 10px;
}

.psd-layer-type {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--psd-border);
  border-radius: var(--rect-radius, 8px);
  color: #344054;
  background: #fff;
  font-size: 12px;
}

.psd-layer-copy {
  min-width: 0;
  display: grid;
  flex: 1;
  gap: 2px;
}

.psd-layer-copy strong,
.psd-layer-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.psd-layer-copy strong {
  color: #344054;
  font-size: 14px;
  line-height: 22px;
  font-weight: 500;
}

.psd-layer-copy small {
  color: #98a2b3;
  font-size: 12px;
  line-height: 18px;
}

.psd-layer-actions {
  gap: 6px;
}

.psd-layer-action {
  min-width: 56px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d8e1ea;
  color: #344054;
  background: #fff;
  font-size: 14px;
  font-weight: 400;
}

.psd-layer-action.is-generate {
  border-color: #9fdef4;
  color: var(--psd-brand);
  background: #fff;
}

.psd-properties {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  margin: 0;
  padding: 16px;
  font-size: 12px;
}

.psd-properties dt,
.psd-properties dd {
  min-height: 42px;
  display: flex;
  align-items: center;
  margin: 0;
  border-bottom: 1px solid #edf2f6;
}

.psd-properties dt {
  color: var(--psd-muted);
}

.psd-properties dd {
  color: #253247;
  font-weight: 600;
}

.psd-version-list {
  padding: 12px;
}

.psd-version-row {
  width: 100%;
  min-height: 54px;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 12px;
  border: 1px solid var(--psd-border);
  color: #344156;
  background: #fff;
  font-size: 12px;
}

.psd-version-row.is-current {
  border-color: #9de2f8;
  background: #eaf9fe;
}

.psd-empty {
  margin: 24px 12px;
  color: var(--psd-muted);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.psd-projects-statusbar {
  justify-content: space-between;
  gap: 20px;
  padding: 0 12px;
  border: 1px solid var(--psd-border);
  border-top: 0;
  border-radius: 0 0 var(--rect-radius, 8px) var(--rect-radius, 8px);
  color: var(--psd-muted);
  background: #fff;
  font-size: 11px;
}

.psd-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(20, 32, 48, 0.42);
  backdrop-filter: blur(3px);
}

.psd-modal-panel {
  width: min(1040px, calc(100vw - 48px));
  max-height: calc(100dvh - 48px);
  display: grid;
  overflow: hidden;
  border: 1px solid var(--psd-border, #e2eaf2);
  border-radius: var(--rect-radius, 8px);
  background: #fff;
  box-shadow: 0 28px 90px rgba(17, 31, 49, 0.24);
}

.psd-candidate-modal {
  width: min(608px, calc(100vw - 48px));
  grid-template-rows: 64px auto minmax(0, 1fr);
}

.psd-replace-modal {
  grid-template-rows: 64px 52px minmax(260px, 1fr) 68px;
  height: min(760px, calc(100dvh - 64px));
}

.psd-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 0 20px;
  border-bottom: 1px solid var(--psd-border, #e2eaf2);
}

.psd-modal-head h3 {
  margin: 0;
  color: #1c2738;
  font-size: 16px;
  font-weight: 700;
}

.psd-modal-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid var(--psd-border, #e2eaf2);
  border-radius: var(--rect-radius, 8px);
  color: #657286;
  background: #fff;
  font-size: 22px;
  line-height: 1;
}

.psd-candidate-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--psd-border, #e2eaf2);
}

.psd-candidate-form label {
  color: #4f5d70;
  font-size: 12px;
  font-weight: 600;
}

.psd-candidate-prompt,
.psd-candidate-select {
  width: 100%;
  border: 1px solid var(--psd-border, #e2eaf2);
  border-radius: var(--rect-radius, 8px);
  outline: none;
  color: #263247;
  background: #fff;
  font: inherit;
  box-sizing: border-box;
}

.psd-candidate-prompt {
  height: 128px;
  min-height: 128px;
  resize: none;
  padding: 12px;
  font-size: 13px;
  line-height: 1.6;
}

.psd-candidate-select {
  height: 40px;
  padding: 0 10px;
  font-size: 12px;
}

.psd-candidate-prompt:focus,
.psd-candidate-select:focus {
  border-color: var(--psd-brand, #00afe9);
  box-shadow: 0 0 0 3px rgba(0, 175, 233, 0.1);
}

.psd-candidate-primary-grid {
  display: grid;
  grid-template-columns: 192px minmax(0, 1fr);
  gap: 16px;
}

.psd-candidate-reference-field,
.psd-candidate-prompt-field,
.psd-candidate-settings-grid > div {
  display: grid;
  gap: 8px;
}

.psd-candidate-reference-field,
.psd-candidate-prompt-field {
  grid-template-rows: auto 128px;
}

.psd-candidate-reference-upload {
  position: relative;
  min-height: 128px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  overflow: hidden;
  border: 1px dashed #9ddff6;
  border-radius: var(--rect-radius, 8px);
  background: #f4fbfe;
}

.psd-candidate-reference-upload.has-image {
  border-style: solid;
  background: #eef8fc;
}

.psd-candidate-reference-input {
  display: none;
}

.psd-candidate-reference-empty {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: var(--rect-radius, 8px);
  background: transparent;
  cursor: pointer;
}

.psd-candidate-reference-empty:hover {
  background: rgba(102, 112, 133, 0.04);
}

.psd-candidate-reference-empty:focus-visible {
  outline: 2px solid var(--psd-brand, #00afe9);
  outline-offset: -3px;
}

.psd-candidate-reference-empty:disabled {
  cursor: wait;
  opacity: 0.55;
}

.psd-candidate-reference-icon {
  width: 20px;
  height: 20px;
  display: block;
  transform: translateY(-10px);
}

.psd-candidate-reference-help {
  position: absolute;
  right: 8px;
  bottom: 20px;
  left: 8px;
  z-index: 1;
  pointer-events: none;
  color: #8591a2;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

.psd-candidate-reference-preview {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.psd-candidate-reference-actions {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: flex;
  gap: 6px;
}

.psd-candidate-reference-button {
  min-width: 48px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #d8e3eb;
  border-radius: var(--rect-radius, 8px);
  color: #4f5d70;
  background: rgba(255, 255, 255, 0.94);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
}

.psd-candidate-reference-button.is-danger {
  color: var(--psd-danger, #cd140f);
}

.psd-candidate-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 16px;
}

.psd-candidate-settings-grid .psd-choice-row {
  gap: 4px;
}

.psd-candidate-settings-grid .psd-choice {
  font-size: 14px;
  font-weight: 400;
}

.psd-choice-row,
.psd-reference-list,
.psd-candidate-actions,
.psd-modal-actions,
.psd-replace-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.psd-choice,
.psd-reference-chip,
.psd-candidate-button,
.psd-candidate-submit,
.psd-replace-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--rect-radius, 8px);
  font: inherit;
  font-weight: 600;
}

.psd-choice,
.psd-reference-chip {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--psd-border, #e2eaf2);
  color: #657286;
  background: #fff;
  font-size: 11px;
}

.psd-choice.is-active,
.psd-reference-chip.is-active {
  border-color: var(--psd-brand, #00afe9);
  color: var(--psd-brand, #00afe9);
  background: #eaf9fe;
}

.psd-candidate-submit,
.psd-replace-submit {
  justify-self: end;
  min-width: 120px;
  height: 40px;
  padding: 0 18px;
  border: 1px solid var(--psd-brand, #00afe9);
  color: #fff;
  background: var(--psd-brand, #00afe9);
  font-size: 13px;
}

.psd-candidate-submit {
  min-width: 96px;
  height: 34px;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 400;
  border-color: rgba(0, 175, 233, 0.3);
  color: #344054;
  background: rgba(255, 255, 255, 0.82);
  transition:
    border-color 160ms ease,
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.psd-candidate-submit:hover:not(:disabled) {
  color: var(--psd-brand, #00afe9);
  border-color: rgba(0, 175, 233, 0.44);
  background: rgba(255, 255, 255, 0.96);
  transform: translateY(-1px);
}

.psd-candidate-submit:active:not(:disabled) {
  transform: translateY(0);
}

.psd-candidate-submit:focus-visible {
  outline: 3px solid rgba(0, 175, 233, 0.2);
  outline-offset: 2px;
}

.psd-candidate-submit:disabled {
  border-color: #d8e1ea;
  color: #98a2b3;
  background: #f2f4f7;
  cursor: not-allowed;
  transform: none;
}

.psd-candidate-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
  overflow: auto;
  padding: 16px 20px 20px;
}

.psd-candidate-card {
  min-width: 0;
  align-self: start;
  overflow: hidden;
  border: 1px solid var(--psd-border, #e2eaf2);
  border-radius: var(--rect-radius, 8px);
  background: #fff;
}

.psd-candidate-card.is-failed {
  border-color: #efc1bf;
}

.psd-candidate-preview {
  aspect-ratio: 4 / 3;
  display: grid;
  place-items: center;
  overflow: hidden;
  color: #778397;
  background: #f2f8fc;
  font-size: 12px;
}

.psd-candidate-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.psd-candidate-meta {
  padding: 10px 12px 4px;
}

.psd-candidate-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: #647286;
  background: #eef3f7;
  font-size: 10px;
  font-weight: 600;
}

.psd-candidate-status.is-ready,
.psd-candidate-status.is-adopted {
  color: #087536;
  background: #e9f8ef;
}

.psd-candidate-status.is-failed {
  color: var(--psd-danger, #cd140f);
  background: #fff0ef;
}

.psd-candidate-actions {
  flex-wrap: wrap;
  padding: 8px 12px 12px;
}

.psd-candidate-button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--psd-border, #e2eaf2);
  color: #526075;
  background: #fff;
  font-size: 11px;
}

.psd-candidate-button.is-primary {
  border-color: var(--psd-brand, #00afe9);
  color: #fff;
  background: var(--psd-brand, #00afe9);
}

.psd-candidate-button.is-quiet {
  color: #7b8798;
}

.psd-form-error {
  margin: 0;
  color: var(--psd-danger, #cd140f);
  font-size: 12px;
}

.psd-replace-tabs {
  padding: 0 20px;
  border-bottom: 1px solid var(--psd-border, #e2eaf2);
}

.psd-replace-tabs button {
  position: relative;
  min-width: 100px;
  height: 52px;
  border: 0;
  color: #6d798b;
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
}

.psd-replace-tabs button.is-active {
  color: var(--psd-brand, #00afe9);
}

.psd-replace-tabs button.is-active::after {
  content: "";
  position: absolute;
  right: 14px;
  bottom: 0;
  left: 14px;
  height: 2px;
  background: var(--psd-brand, #00afe9);
}

.psd-replace-content {
  min-height: 0;
  overflow: auto;
  padding: 18px 20px;
  background: #f8fbfd;
}

.psd-replace-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.psd-replace-card {
  min-width: 0;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--psd-border, #e2eaf2);
  border-radius: var(--rect-radius, 8px);
  color: #3f4c5f;
  background: #fff;
  text-align: left;
}

.psd-replace-card.is-active {
  border-color: var(--psd-brand, #00afe9);
  box-shadow: 0 0 0 1px var(--psd-brand, #00afe9);
}

.psd-replace-card img {
  width: 100%;
  aspect-ratio: 1;
  display: block;
  object-fit: cover;
}

.psd-replace-card span {
  display: block;
  overflow: hidden;
  padding: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 11px;
}

.psd-replace-upload {
  min-height: 300px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 16px;
  border: 1px dashed #a9c6d5;
  border-radius: var(--rect-radius, 8px);
  color: #536175;
  background: #fff;
}

.psd-modal-actions {
  justify-content: space-between;
  padding: 0 20px;
  border-top: 1px solid var(--psd-border, #e2eaf2);
}

@media (max-width: 1599px) {
  .psd-replace-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1599px) {
  #psdLayerProjectsRoot {
    height: calc(100dvh - 60px);
  }

  .psd-projects-page {
    padding-right: 12px;
    padding-left: 12px;
  }

  .psd-projects-grid {
    grid-template-columns: 280px minmax(0, 1fr) 340px;
  }

  .psd-stage-body {
    padding: 20px;
  }

  .psd-layer-row {
    min-height: 64px;
    gap: 6px;
    padding: 8px;
  }

  .psd-layer-action {
    min-width: 46px;
    height: 32px;
    padding: 0 8px;
    font-size: 12px;
  }

  .psd-project-list,
  .psd-layer-list {
    padding: 12px;
  }

  .psd-project-card {
    min-height: 96px;
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .psd-project-thumb {
    width: 56px;
    height: 56px;
  }
}

@media (max-width: 640px) {
  .psd-candidate-primary-grid,
  .psd-candidate-settings-grid {
    grid-template-columns: 1fr;
  }

  .psd-candidate-grid {
    grid-template-columns: 1fr;
  }

  .psd-conflict-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .psd-conflict-button {
    width: 100%;
  }
}
