.studio-editor-page {
  min-height: 100vh;
  background: #f2f2f7;
  color: #232236;
}
.studio-editor-page button,
.studio-editor-page input,
.studio-editor-page select,
.studio-editor-page textarea {
  font-family: inherit;
}
.editor-header {
  min-height: 74px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 18px;
  background: #fff;
  border-bottom: 1px solid #e3e2eb;
}
.editor-header .studio-brand { white-space: nowrap; }
.editor-project-name { display: grid; gap: 3px; min-width: 170px; }
.editor-project-name label { font-size: 10px; font-weight: 700; color: #666a7a; }
.editor-project-name input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 7px 8px;
  font-size: 14px;
  font-weight: 700;
  color: #252338;
}
.editor-project-name input:focus { border-color: #6d4aff; outline: 2px solid #d9d0ff; }
.editor-header-actions { margin-inline-start: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.editor-back-link { font-size: 12px; font-weight: 700; color: #514875; padding: 8px; }
.editor-action, .editor-small-button {
  min-height: 38px;
  padding: 8px 12px;
  border: 1px solid #dedce8;
  border-radius: 9px;
  background: #fff;
  color: #383449;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.editor-action:hover, .editor-small-button:hover { background: #f6f3ff; border-color: #c8bbfa; }
.editor-action-strong { background: #6d4aff; border-color: #6d4aff; color: #fff; }
.editor-action-strong:hover { background: #5838dc; color: #fff; }
.editor-save { color: #4e3c91; }
.editor-app { min-height: calc(100vh - 123px); display: grid; grid-template-columns: 235px minmax(0, 1fr) 265px; gap: 0; }
.editor-sidebar { padding: 22px 16px; background: #fff; min-width: 0; }
.editor-tools { border-inline-end: 1px solid #e5e4ed; }
.editor-inspector { border-inline-start: 1px solid #e5e4ed; }
.editor-panel-heading .eyebrow { font-size: 10px; }
.editor-panel-heading h1, .editor-panel-heading h2 { font-size: 19px; margin: 7px 0; }
.editor-panel-heading p { font-size: 12px; line-height: 1.6; color: #747487; margin: 0 0 19px; }
.editor-add-tools { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.editor-tool-button {
  position: relative;
  min-height: 70px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 7px;
  padding: 10px 11px;
  border: 1px solid #e4e2ec;
  border-radius: 11px;
  background: #fff;
  color: #3a374c;
  font-size: 12px;
  font-weight: 700;
  text-align: start;
  cursor: pointer;
}
.editor-tool-button:hover { background: #f7f4ff; border-color: #cfc3fb; }
.editor-tool-button > span { font-size: 20px; color: #6d4aff; line-height: 1; }
.editor-upload-button input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.editor-size-panel { margin-top: 23px; padding-top: 17px; border-top: 1px solid #ecebf1; display: grid; gap: 9px; }
.editor-size-panel h2 { font-size: 14px; margin: 0 0 3px; }
.editor-size-panel label, .editor-inspector label { display: grid; gap: 5px; font-size: 11px; font-weight: 700; color: #565569; }
.editor-size-panel select, .editor-size-panel input[type="number"], .editor-inspector input[type="number"], .editor-inspector textarea {
  width: 100%;
  min-height: 37px;
  border: 1px solid #dddae6;
  border-radius: 8px;
  background: #fff;
  padding: 8px;
  font-size: 12px;
  color: #29273b;
}
.background-control { grid-template-columns: 1fr auto !important; align-items: center; margin-top: 5px; }
.background-control input { width: 40px; height: 32px; padding: 2px; border: 1px solid #dddae6; border-radius: 6px; background: #fff; }
.custom-size { display: grid; gap: 9px; padding: 10px; background: #f7f6fb; border-radius: 9px; }
.custom-size[hidden], .editor-inspector form[hidden] { display: none; }
.editor-small-button { font-size: 10px; padding: 7px 9px; }
.editor-local-note { margin: 20px 0 0; padding: 11px; background: #f2f5ff; border-radius: 9px; color: #505879; font-size: 10px; line-height: 1.55; }
.editor-local-note span { color: #6d4aff; }
.editor-workspace { min-width: 0; display: grid; grid-template-rows: auto minmax(350px, 1fr) auto; }
.workspace-toolbar { min-height: 52px; padding: 10px 16px; display: flex; align-items: center; gap: 16px; background: #fbfbfd; border-bottom: 1px solid #e7e6ed; font-size: 10px; color: #727286; }
.workspace-toolbar .workspace-label { font-weight: 800; color: #47445d; white-space: nowrap; }
.workspace-toolbar a { margin-inline-start: auto; white-space: nowrap; color: #6343cc; font-weight: 750; }
.canvas-viewport {
  min-height: 360px;
  overflow: auto;
  display: grid;
  place-items: start center;
  padding: 30px;
  background-color: #e7e7ef;
  background-image: radial-gradient(#c4c3cf .7px, transparent .7px);
  background-size: 16px 16px;
}
.design-canvas {
  position: relative;
  width: min(100%, 740px);
  height: auto;
  min-height: 240px;
  overflow: hidden;
  container-type: inline-size;
  border-radius: 3px;
  box-shadow: 0 15px 45px #24223730;
  background: #fff;
  touch-action: pan-x pan-y;
}
.design-item { position: absolute; display: flex; align-items: flex-start; justify-content: flex-start; outline: 1px solid transparent; cursor: move; touch-action: none; user-select: none; }
.design-item.is-selected { outline: 2px solid #6d4aff; outline-offset: 2px; z-index: 20; }
.design-text { width: 100%; height: 100%; overflow: hidden; white-space: pre-wrap; line-height: 1.07; overflow-wrap: anywhere; outline: none; user-select: text; cursor: text; }
.design-item.item-image img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; user-select: none; }
.shape-rectangle, .shape-circle { min-height: 12px; min-width: 12px; }
.shape-circle { border-radius: 50%; }
.move-grip { position: absolute; top: -10px; inset-inline-end: -10px; display: none; width: 20px; height: 20px; border: 2px solid #fff; border-radius: 50%; background: #6d4aff; box-shadow: 0 1px 5px #27223a55; cursor: move; touch-action: none; }
.is-selected .move-grip { display: block; }
.workspace-status { min-height: 38px; padding: 8px 14px; display: flex; justify-content: space-between; gap: 12px; background: #fff; border-top: 1px solid #e6e5ed; color: #69697c; font-size: 10px; }
.workspace-status #saveStatus { font-weight: 750; color: #514675; }
.editor-inspector form { display: grid; gap: 13px; }
.editor-inspector textarea { resize: vertical; min-height: 68px; }
.editor-inspector input[type="color"] { width: 44px; height: 34px; padding: 2px; border: 1px solid #dedbe6; border-radius: 7px; background: #fff; }
.position-grid, .layer-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.editor-danger { color: #a63d49; border-color: #edd7da; }
.editor-danger:hover { background: #fff0f1; border-color: #d9a2a9; }
.editor-footer { min-height: 48px; padding: 12px 18px; display: flex; gap: 18px; align-items: center; background: #fff; border-top: 1px solid #e6e5ed; color: #747386; font-size: 10px; }
.editor-footer a { color: #5e4b91; font-weight: 700; }
.editor-footer span { margin-inline-start: auto; }
.studio-editor-page :focus-visible { outline: 3px solid #322080; outline-offset: 3px; }
@media (max-width: 1040px) {
  .editor-app { grid-template-columns: 205px minmax(0, 1fr) 230px; }
  .editor-sidebar { padding: 18px 12px; }
  .editor-header { gap: 10px; }
  .editor-header-actions { gap: 5px; }
  .editor-action { padding: 7px 9px; font-size: 11px; }
  .editor-back-link { font-size: 11px; padding: 6px; }
}
@media (max-width: 780px) {
  .editor-header { flex-wrap: wrap; }
  .editor-project-name { flex: 1; }
  .editor-header-actions { order: 3; width: 100%; justify-content: flex-start; }
  .editor-app { grid-template-columns: 190px minmax(0, 1fr); }
  .editor-inspector { grid-column: 1 / -1; border-inline-start: 0; border-top: 1px solid #e5e4ed; }
  .editor-inspector form { grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; }
  .editor-inspector .editor-panel-heading { margin-bottom: 13px; }
  .canvas-viewport { padding: 18px; }
  .workspace-toolbar { flex-wrap: wrap; gap: 8px; }
  .workspace-toolbar #editorHint { flex: 1 1 100%; order: 3; }
}
@media (max-width: 540px) {
  .editor-header { padding: 9px 11px; }
  .editor-header .studio-brand span { font-size: 16px; }
  .editor-project-name { min-width: 130px; }
  .editor-header-actions { gap: 5px; }
  .editor-action { font-size: 10px; min-height: 34px; padding: 6px 8px; }
  .editor-back-link { font-size: 10px; }
  .editor-app { grid-template-columns: 1fr; }
  .editor-tools { border-inline-end: 0; border-bottom: 1px solid #e5e4ed; padding: 14px; }
  .editor-panel-heading p { margin-bottom: 10px; }
  .editor-panel-heading h1 { font-size: 17px; }
  .editor-add-tools { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .editor-tool-button { min-height: 58px; padding: 8px; font-size: 10px; }
  .editor-size-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: end; margin-top: 14px; padding-top: 12px; }
  .editor-size-panel h2, .editor-size-panel > label:first-of-type, .custom-size { grid-column: 1 / -1; }
  .editor-local-note { margin-top: 12px; }
  .editor-workspace { grid-row: 2; grid-template-rows: auto minmax(300px, 1fr) auto; }
  .canvas-viewport { min-height: 320px; padding: 12px; }
  .editor-inspector { grid-row: 3; padding: 15px; }
  .editor-inspector form { grid-template-columns: 1fr 1fr; }
  .editor-inspector #textProperty, .editor-inspector .layer-actions:last-child { grid-column: 1 / -1; }
  .workspace-status { flex-direction: column; gap: 4px; }
  .editor-footer { flex-wrap: wrap; }
  .editor-footer span { width: 100%; margin: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .editor-action, .editor-small-button { transition: none; }
}
