@import url("./fonts.css");
@import url("./canvas-touch.css");
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f1f0ed;
  color: #1b1b1b;
  font: 14px var(--font-ui);
}
:is(button,input,textarea,select) {
  font: inherit;
}
:is(button,a,input,textarea,select) {
  outline-offset: 4px;
}
button {
  cursor: pointer;
  border: 1px solid #deddd9;
  border-radius: 9px;
  background: #fff;
  padding: 9px 12px;
  color: inherit;
}
button:hover {
  background: #f1f0ec;
}
button:disabled {
  opacity: 0.45;
  cursor: default;
}
button.primary {
  background: #1b1b1b;
  color: white;
  border-color: #1b1b1b;
}
a {
  color: inherit;
}
:is(h1,h2,h3,p) {
  margin-top: 0;
}
.boot {
  padding: 40px;
}
.studio-top {
  height: 72px;
  background: #faf9f6;
  border-bottom: 1px solid #deddd9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 20px;
}
.studio-brand {
  font-size: 22px;
  letter-spacing: -1px;
  text-decoration: none;
  font-weight: 800;
}
.studio-top .page-title {
  width: 170px;
  border: 0;
  background: transparent;
  font-weight: 600;
}
:is(.top-actions,.canvas-tools,.row-actions) {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.save-status {
  font-size: 12px;
  color: #65645d;
  min-width: 100px;
}
.workspace {
  display: grid;
  grid-template-columns: 260px minmax(300px, 1fr) 300px;
  height: calc(100dvh - 72px);
}
.panel {
  background: #faf9f6;
  overflow: auto;
  padding: 20px;
  border-right: 1px solid #deddd9;
}
.properties {
  border-left: 1px solid #deddd9;
  border-right: 0;
}
.panel h2 {
  font-size: 16px;
  letter-spacing: -0.4px;
}
.panel h3 {
  font-size: 13px;
  margin: 24px 0 12px;
}
.panel label {
  display: block;
  font-size: 12px;
  color: #53524d;
  margin: 12px 0;
}
.panel input:not([type="checkbox"]),
.panel textarea,
.panel select,
.auth-card input {
  display: block;
  width: 100%;
  padding: 10px;
  border: 1px solid #dcdad5;
  border-radius: 7px;
  background: white;
  color: #222;
  margin-top: 6px;
}
.panel textarea {
  min-height: 78px;
  resize: vertical;
}
.panel input[type="color"] {
  height: 40px;
  padding: 4px;
}
.panel input[type="checkbox"] {
  vertical-align: middle;
  margin-right: 7px;
}
.field-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.tabbar {
  display: flex;
  gap: 5px;
  margin-bottom: 20px;
}
.tabbar button {
  flex: 1;
  padding: 8px;
  font-size: 12px;
}
.tabbar button[aria-selected="true"] {
  background: #222;
  color: white;
  border-color: #222;
}
.layer {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 6px 0;
  border: 1px solid #e0ded8;
  border-radius: 8px;
  padding: 4px;
  background: white;
}
.layer.selected {
  border-color: #1b1b1b;
  box-shadow: 0 0 0 1px #1b1b1b;
}
.layer > button {
  border: 0;
  text-align: left;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.layer > span {
  color: #999;
  cursor: grab;
  padding: 4px;
}
.layer small {
  font-size: 10px;
}
.layer.drag-over {
  border: 2px dashed #444;
}
.block-search {
  width: 100%;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  margin: 8px 0 12px;
}
.block-library {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.block-library button {
  text-align: left;
  padding: 12px 8px;
  font-size: 12px;
}
.library-group {
  grid-column: 1/-1;
  color: #777;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 12px;
}
.canvas-area {
  overflow: auto;
  position: relative;
  background: radial-gradient(#d5d3cc 0.8px, transparent 0.8px);
  background-size: 16px 16px;
  padding: 18px 28px 80px;
}
.canvas-tools {
  position: sticky;
  top: 0;
  z-index: 5;
  width: max-content;
  max-width: 100%;
  margin: 0 auto 24px;
  padding: 6px;
  background: #faf9f6;
  box-shadow: 0 3px 20px #0000000a;
  border-radius: 12px;
  border: 1px solid #deddd9;
}
.canvas-tools button,
.canvas-tools select {
  font-size: 12px;
  padding: 7px;
  border-radius: 6px;
}
.canvas-wrap {
  margin: auto;
  width: 390px;
  max-width: none;
  min-height: 700px;
  box-shadow: 0 16px 55px #0000001a;
  background: white;
  transform-origin: top center;
  border-radius: 16px;
  overflow: hidden;
}
.canvas-wrap [data-block-id] {
  position: relative;
}
.canvas-wrap.editing [data-block-id] {
  cursor: pointer;
}
.canvas-wrap.editing .sp-embed { pointer-events: none; }
.canvas-wrap.editing [data-block-id]:hover {
  outline: 1px dashed #7277cf;
  outline-offset: 3px;
}
.canvas-wrap.editing [data-block-id].is-selected {
  outline: 2px solid #6457d8;
  outline-offset: 3px;
}
.canvas-wrap.editing .canvas-drop-before { box-shadow: inset 0 4px #6457d8 !important; }
.canvas-wrap.editing .canvas-drop-after { box-shadow: inset 0 -4px #6457d8 !important; }
.canvas-wrap.editing [data-block-id].canvas-drop-inside { outline: 2px dashed #6457d8; }
.canvas-wrap.editing.canvas-drop-end { outline: 2px dashed #6457d8; outline-offset: 4px; }
.canvas-wrap [contenteditable="true"] {
  outline: 1px dashed #6457d8;
}
.helper {
  font-size: 12px;
  line-height: 1.6;
  color: #79766d;
}
.empty {
  padding: 30px 10px;
  text-align: center;
  color: #777;
  font-size: 13px;
  line-height: 1.6;
}
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #222;
  color: #fff;
  padding: 13px 22px;
  border-radius: 10px;
  z-index: 100;
  max-width: 90vw;
  box-shadow: 0 6px 35px #0002;
}
.drawer {
  position: fixed;
  inset: 0;
  background: #0005;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
}
.dialog {
  width: 680px;
  max-width: 100%;
  max-height: 90dvh;
  overflow: auto;
  background: #faf9f6;
  border-radius: 18px;
  padding: 28px;
}
.dialog header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.dialog header h2 {
  margin: 0;
  font-size: 22px;
}
.dialog label {
  display: block;
  font-size: 13px;
  margin: 14px 0;
}
.dialog :is(input,textarea,select) {
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  width: 100%;
  display: block;
  margin-top: 6px;
}
.dialog .list-item {
  padding: 14px 0;
  border-bottom: 1px solid #deddd9;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.auth-card {
  max-width: 420px;
  margin: 10vh auto;
  padding: 32px;
  background: #fff;
  border: 1px solid #e1dfd9;
  border-radius: 20px;
}
.auth-card h1 {
  font-size: 32px;
  letter-spacing: -1.3px;
}
.auth-card label {
  display: block;
  margin: 16px 0;
}
.auth-card button.primary {
  width: 100%;
  padding: 13px;
  margin: 8px 0;
}
.auth-card .auth-switch {
  border: 0;
  background: none;
  width: 100%;
  font-size: 12px;
}
.error {
  color: #a72c2c;
  font-size: 13px;
  line-height: 1.5;
}
.media-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.media-grid article {
  position: relative;
  border: 1px solid #ddd;
  padding: 8px;
  border-radius: 9px;
}
.media-grid img {
  width: 100%;
  height: 100px;
  object-fit: cover;
  border-radius: 5px;
}
.media-grid button {
  font-size: 11px;
  padding: 5px;
}
.media-grid small {
  display: block;
  margin: 6px 0;
  word-break: break-all;
}
.upload-zone {
  border: 1px dashed #bdb9af;
  padding: 24px;
  text-align: center;
  margin: 15px 0;
  border-radius: 12px;
}
.mobile-panel-toggle {
  display: none;
}
.studio-preview .left-panel,
.studio-preview .properties {
  display: none;
}
.studio-preview .workspace {
  grid-template-columns: 1fr;
}
.studio-preview .canvas-wrap {
  max-width: 100%;
}
.property-details {
  border-top: 1px solid #deddd9;
  margin-top: 20px;
  padding-top: 16px;
}
.property-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
}
.account-button {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.upload-crop {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
}
.wide-button {
  width: 100%;
  margin-top: 10px;
}
.publish-link {
  display: block;
  overflow-wrap: anywhere;
  padding: 14px;
  background: #eae8df;
  border-radius: 8px;
}
.hidden {
  display: none !important;
}
@media (max-width: 1100px) {
  .workspace {
    grid-template-columns: 220px minmax(280px, 1fr) 260px;
  }
  .panel {
    padding: 15px;
  }
  .studio-top {
    padding: 0 14px;
  }
  .studio-brand {
    font-size: 18px;
  }
  .top-actions {
    gap: 4px;
  }
  .save-status {
    min-width: 60px;
    font-size: 11px;
  }
  .studio-top .page-title {
    width: 110px;
  }
}
@media (max-width: 850px) {
  .studio-top {
    height: auto;
    min-height: 66px;
    padding: 12px;
    flex-wrap: wrap;
    gap: 10px;
  }
  .studio-top .top-actions {
    margin-left: auto;
  }
  .account-button {
    display: none;
  }
  .workspace {
    display: block;
    height: calc(100dvh - 110px);
  }
  .left-panel,
  .properties {
    display: none;
    position: fixed;
    top: 110px;
    bottom: 55px;
    z-index: 20;
    width: min(330px, 90vw);
    box-shadow: 0 0 60px #0003;
  }
  .left-panel {
    left: 0;
  }
  .properties {
    right: 0;
  }
  .show-layers .left-panel,
  .show-properties .properties {
    display: block;
  }
  .canvas-area {
    height: 100%;
    padding: 16px 12px 70px;
  }
  .mobile-panel-toggle {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #faf9f6;
    border-top: 1px solid #ddd;
    padding: 8px;
    gap: 8px;
    z-index: 21;
  }
  .mobile-panel-toggle button {
    flex: 1;
  }
  .canvas-wrap {
    min-height: 600px;
  }
  .studio-brand {
    font-size: 18px;
  }
  .studio-top .page-title {
    width: 110px;
  }
  .top-actions button {
    padding: 8px;
    font-size: 12px;
  }
  .save-status {
    font-size: 10px;
    min-width: 55px;
  }
  .dialog {
    padding: 20px;
  }
  .drawer {
    padding: 12px;
  }
  .media-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.resize-handle {
  position: absolute !important;
  right: -5px;
  bottom: -5px;
  z-index: 12;
  width: 28px;
  height: 28px;
  padding: 5px !important;
  border-radius: 5px !important;
  border: 1px solid #6457d8 !important;
  background: #fff !important;
  cursor: nwse-resize;
  touch-action: none;
  box-shadow: 0 2px 5px #0002;
}
.resize-handle img {
  width: 16px !important;
  height: 16px !important;
  object-fit: contain !important;
  border-radius: 0 !important;
}
.reset-property {
  font-size: 10px;
  padding: 3px 5px;
  border: 0;
  color: #777;
  background: transparent;
  float: right;
  margin-top: 3px;
}
.richtext-tools {
  display: flex;
  gap: 5px;
  margin-top: 16px;
}
.richtext-tools button {
  font-size: 11px;
  padding: 5px 8px;
}
.gradient-stop {
  display: grid;
  grid-template-columns: 40px 1fr 55px;
  gap: 5px;
  align-items: center;
  margin: 6px 0;
}
.gradient-stop input {
  margin: 0 !important;
  min-width: 0;
}
.gradient-stop button {
  font-size: 10px;
  padding: 7px 3px;
}
.design-composer {
  border: 1px solid #deddd9;
  border-radius: 10px;
  padding: 10px;
  margin: 12px 0;
}
.design-composer h3 {
  margin-top: 0;
}
.design-composer label {
  margin: 8px 0;
}
.gradient-stop input[type="color"] {
  width: 40px !important;
}
