/* Owner editing surfaces only. Public Renderer themes remain independent. */
.site-admin-shell,.site-admin-shell *,.site-admin-shell *::before,.site-admin-shell *::after {
  box-sizing:border-box;
}

.builder-shell,.site-admin-shell {
  --editor-paper:#fffefa;
  --editor-bg:#f1f0ec;
  --editor-ink:#292e29;
  --editor-muted:#747d72;
  --editor-line:#dfe4d9;
  --editor-green:#355344;
  background:var(--editor-bg);
  color:var(--editor-ink);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC",sans-serif;
}

.builder-shell button,.site-admin-shell button {
  transition:background .15s,color .15s;
  cursor:pointer;
}

.builder-shell button:disabled,.site-admin-shell button:disabled {
  cursor:not-allowed;
}

.builder-shell button:focus-visible,.site-admin-shell button:focus-visible {
  outline:2px solid #668269;
  outline-offset:3px;
}

.builder-shell .primary,.site-admin-shell .site-admin-button:not(.secondary):not(.danger),.site-admin-shell .site-admin-upload {
  background:var(--editor-green);
  color:#fff;
  border-radius:8px;
}

.builder-shell .secondary,.site-admin-shell .site-admin-button.secondary {
  background:var(--editor-paper);
  border:1px solid var(--editor-line);
  color:var(--editor-ink);
  border-radius:8px;
}

.builder-shell .topbar,.site-admin-topbar {
  background:var(--editor-paper);
  border-bottom:1px solid var(--editor-line);
  min-height:76px;
  padding:14px 28px;
  gap:16px;
}

.workspace-brand {
  display:flex;
  gap:12px;
  align-items:center;
  min-width:0;
}

.workspace-brand .brand-mark,.site-admin-brand .commerce-mark {
  background:var(--editor-green);
  color:#fff;
  border-radius:10px;
  width:36px;
  height:36px;
  display:inline-grid;
  place-items:center;
  font:24px Georgia,serif;
  flex-shrink:0;
}

.workspace-brand-divider {
  height:26px;
  width:1px;
  background:var(--editor-line);
  margin:0 8px;
}

#builderProjectName {
  max-width:240px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  font-size:13px;
}

.builder-shell .topbar-actions {
  gap:8px;
  flex-wrap:wrap;
}

.builder-shell .topbar-actions button {
  min-height:40px;
}

.builder-shell .workspace {
  display:block;
  min-height:calc(100dvh - 76px);
}

.builder-shell .preview-panel {
  max-width:1240px;
  padding:18px 32px 32px;
  margin:auto;
  background:transparent;
  min-height:0;
}

.builder-shell .preview-toolbar {
  height:auto;
  min-height:26px;
  font-size:11px;
  color:var(--editor-muted);
}

.builder-shell .preview-edit-toolbar {
  display:flex;
  justify-content:space-between;
  align-items:center;
  flex-wrap:wrap;
  border:0;
  background:transparent;
  padding:10px 0;
  gap:12px;
}

.workspace-tools {
  display:flex;
  gap:5px;
  align-items:center;
}

.builder-shell .workspace-tools button {
  background:transparent;
  border-color:transparent;
  padding:9px 13px;
  min-height:40px;
  font-size:12px;
}

.builder-shell .workspace-tools button:hover,.builder-shell .workspace-tools button[aria-pressed=true] {
  background:#e0e7dc;
}

.builder-shell .preview-edit-hint {
  color:var(--editor-muted);
  font-size:11px;
  padding:0;
  margin:10px 0 15px;
}

.builder-shell .preview-panel iframe {
  display:block;
  width:100%;
  height:calc(100dvh - 240px);
  min-height:440px;
  margin:auto;
  border-radius:8px;
  box-shadow:0 12px 50px #303c2b12;
  background:var(--editor-paper);
}

.builder-shell .preview-panel iframe.phone-preview {
  max-width:390px;
}

.builder-shell [hidden] {
  display:none!important;
}

.workspace-status {
  display:flex;
  flex-wrap:wrap;
  gap:8px 24px;
  align-items:start;
  font-size:11px;
}

.workspace-status>section {
  padding:0;
  flex:1;
  min-width:220px;
}

.workspace-status .section-title-row,.workspace-status .editor-help {
  display:none;
}

.workspace-status .status {
  margin:0;
  padding:8px 0;
  color:var(--editor-muted);
  font-size:11px;
}

.workspace-status .status[data-state=error] {
  color:#a24131;
}

.workspace-status .status[data-state=saved] {
  color:#486941;
}

.workspace-status .status[data-state=pending],.workspace-status .status[data-state=saving] {
  color:#866331;
}

.workspace-status .section-inline-actions {
  margin:4px 0;
}

.workspace-feedback {
  padding:10px 14px;
  border:1px solid var(--editor-line);
  background:#edf2e8;
  color:#52664b;
  border-radius:8px;
  font-size:12px;
  overflow-wrap:anywhere;
}

.builder-empty-state {
  text-align:center;
  padding:100px 24px;
  background:var(--editor-paper);
  border:1px solid var(--editor-line);
  border-radius:10px;
}

.workspace-eyebrow {
  font-size:10px;
  letter-spacing:.16em;
  color:#7f9178;
}

.builder-empty-state h1 {
  font:400 36px/1.5 "Songti SC",serif;
  margin:20px 0;
}

.builder-empty-state p {
  font-size:13px;
  color:var(--editor-muted);
}

.builder-empty-state button {
  padding:13px 22px;
  margin:20px 0 16px;
}

.builder-empty-state small {
  display:block;
  font-size:11px;
  color:var(--editor-muted);
}

.editor-drawer {
  box-sizing:border-box;
  position:fixed;
  inset:92px 20px 20px auto;
  margin:0;
  width:min(430px,calc(100vw - 40px));
  max-width:none;
  height:calc(100dvh - 112px);
  max-height:none;
  padding:0;
  border:1px solid var(--editor-line);
  border-radius:14px;
  box-shadow:0 18px 70px #24301f2a;
  background:var(--editor-paper);
  color:var(--editor-ink);
  overflow:auto;
}

.editor-drawer::backdrop {
  background:#20302020;
}

.editor-drawer-header {
  position:sticky;
  top:0;
  z-index:5;
  background:var(--editor-paper);
  padding:16px 20px;
  border-bottom:1px solid var(--editor-line);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.editor-drawer-header h2 {
  font-size:16px;
  font-weight:600;
  margin:0;
}

.editor-drawer-header button {
  padding:8px 14px;
}

.builder-shell .editor-panel {
  display:block!important;
  height:auto;
  max-height:none;
  overflow:visible;
  border:0;
  padding:0 22px 24px;
  background:var(--editor-paper);
}

.builder-shell .drawer-section-hidden {
  display:none!important;
}

.builder-shell .editor-panel>section,.builder-shell .editor-panel>details {
  padding:20px 0;
  border-color:var(--editor-line);
}

.builder-shell .editor-panel .upload-box {
  background:#f2f5ec;
  border:1px dashed #b6c2ae;
  border-radius:10px;
}

.builder-shell .editor-panel input,.builder-shell .editor-panel textarea {
  border-radius:7px;
  border-color:var(--editor-line);
}

.builder-shell .section-edit-card {
  background:#fafcf6;
  border-color:var(--editor-line);
  border-radius:10px;
}

.builder-shell .photo-picker-dialog,.builder-shell .style-chooser-dialog {
  border-color:var(--editor-line);
}

.site-admin-workspace {
  max-width:1240px;
  margin:auto;
  width:100%;
  grid-template-columns:minmax(0,1fr) 380px;
  gap:36px;
  min-height:0;
  padding:30px 28px 60px;
}

.site-admin-panel {
  padding:0;
  background:transparent;
  border:0;
  min-width:0;
  overflow:visible;
}

.site-admin-preview {
  background:transparent;
  padding:0;
  position:sticky;
  top:100px;
  align-self:start;
}

.site-admin-preview iframe {
  border-radius:9px;
  border:1px solid var(--editor-line);
  height:calc(100dvh - 170px);
  min-height:460px;
  box-shadow:0 12px 45px #303c2b12;
}

.site-admin-card {
  border:0;
  border-radius:0;
  padding:0;
  background:transparent;
  margin-bottom:24px;
}

.site-admin-card h2 {
  font:400 28px/1.5 "Songti SC",serif;
  margin-bottom:6px;
}

.site-admin-card p {
  font-size:12px;
  color:var(--editor-muted);
}

.site-admin-library-header {
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  margin-bottom:24px;
}

.site-admin-library-header h1 {
  font:400 28px/1.5 "Songti SC",serif;
  margin:0 0 5px;
}

.site-admin-library-header p {
  margin:0;
  color:var(--editor-muted);
  font-size:12px;
}

.site-admin-upload {
  min-height:44px;
  font-size:12px;
  white-space:nowrap;
  position:relative;
}

.site-admin-upload:focus-within {
  outline:2px solid #668269;
  outline-offset:3px;
}

.site-admin-cover-card {
  display:flex;
  align-items:center;
  gap:18px;
  padding:14px;
  background:var(--editor-paper);
  border:1px solid var(--editor-line);
  border-radius:12px;
}

.site-admin-cover-card .site-admin-hero {
  width:130px;
  height:86px;
  flex-shrink:0;
  border-radius:7px;
}

.site-admin-cover-card .site-admin-hero span {
  display:none;
}

.site-admin-cover-copy {
  flex:1;
}

.site-admin-cover-copy h2 {
  font-size:14px;
  font-family:inherit;
  margin:4px 0;
}

.site-admin-cover-copy p {
  margin:0;
  font-size:11px;
}

.site-admin-cover-copy small {
  font-size:9px;
  letter-spacing:.13em;
  color:#8c9587;
}

.site-admin-status {
  background:transparent;
  color:var(--editor-muted);
  border-radius:8px;
  padding:9px 0;
  margin:0;
  font-size:12px;
}

.site-admin-status.error {
  padding:12px;
  background:#faeae5;
  color:#913c30;
}

.site-admin-status.success {
  color:#45683b;
  background:transparent;
}

.site-admin-status[data-state=pending],.site-admin-status[data-state=saving] {
  padding:12px;
  background:#f1ebdb;
}

.site-admin-status[data-state=error] {
  padding:12px;
  background:#faeae5;
  color:#913c30;
}

.site-admin-status[data-state=saved] {
  background:transparent;
}

.site-admin-note {
  line-height:1.7;
}

.site-admin-grid-toolbar {
  margin:0 0 14px;
}

.site-admin-grid-toolbar button {
  padding:8px 12px;
  min-height:40px;
}

.site-admin-grid-toolbar strong {
  font-weight:500;
}

.site-admin-button {
  border-radius:8px;
  min-height:40px;
  font-size:12px;
}

#siteAdminPhotoGrid {
  height:520px;
  min-height:300px;
  background:transparent;
}

.site-admin-photo {
  border:0;
  border-radius:8px;
  background:#e0e5d9;
}

.site-admin-photo.selected {
  outline:3px solid var(--editor-green);
  outline-offset:-3px;
}

.site-admin-photo.hero {
  box-shadow:none;
}

.site-admin-photo-check {
  accent-color:var(--editor-green);
}

.site-admin-photo-main {
  padding:0;
  width:100%;
  height:100%;
  display:block;
  background:none;
  border:0;
  cursor:pointer;
}

.site-admin-photo-main img {
  pointer-events:none;
}

.site-admin-photo-badge {
  position:absolute;
  bottom:8px;
  left:8px;
  background:#fffefae8;
  color:#355344;
  padding:2px 7px;
  border-radius:4px;
  font-size:10px;
  pointer-events:none;
}

.site-admin-selection-bar {
  position:sticky;
  bottom:20px;
  z-index:4;
  padding:10px 14px;
  border-radius:10px;
  background:var(--editor-paper);
  box-shadow:0 8px 30px #24301f22;
  border:1px solid var(--editor-line);
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:8px;
  margin-top:12px;
}

.site-admin-selection-bar .site-admin-inline {
  margin:0;
}

.site-admin-view-tabs {
  display:none;
}

.site-admin-details {
  border-top:1px solid var(--editor-line);
  padding-top:18px;
  margin-top:22px;
}

.site-admin-details>summary {
  cursor:pointer;
  font-size:12px;
  color:var(--editor-muted);
}

.site-admin-details[open]>summary {
  margin-bottom:16px;
}

.site-admin-change-summary {
  padding:12px;
  background:#e9eee3;
  border:1px solid #d8dfcf;
  border-radius:8px;
  color:#53674b;
  font-size:12px;
}

.site-admin-state-line {
  font-size:11px;
  color:var(--editor-muted);
  margin-top:3px;
}

.site-admin-dialog {
  width:min(480px,calc(100vw - 24px));
  max-height:86dvh;
  overflow:auto;
  border:1px solid var(--editor-line);
  border-radius:14px;
  background:var(--editor-paper);
  padding:22px;
  color:var(--editor-ink);
}

.site-admin-dialog::backdrop {
  background:#18201755;
}

.site-admin-dialog h2 {
  font-size:17px;
  margin:0 0 16px;
}

.site-admin-dialog img {
  display:block;
  width:100%;
  max-height:48dvh;
  object-fit:contain;
  border-radius:8px;
  background:#e8eddf;
}

.site-admin-dialog .site-admin-inline {
  justify-content:flex-end;
}

.site-admin-dialog p {
  font-size:12px;
  color:var(--editor-muted);
}

.site-admin-preview-heading {
  font-size:11px;
  color:var(--editor-muted);
  margin:0 0 12px;
}

.site-admin-shell [hidden] {
  display:none!important;
}

.builder-shell .release-confirmation,.site-admin-shell .release-confirmation {
  border-color:var(--editor-line);
  background:var(--editor-paper);
  border-radius:14px;
  color:var(--editor-ink);
}

.release-confirmation h2 {
  font-size:20px;
}

.release-confirmation img {
  border-radius:8px;
}

.release-confirmation .primary {
  background:#355344;
  color:white;
  border:0;
  border-radius:8px;
}

.release-confirmation .secondary {
  background:#f4f6ef;
  border:1px solid #dfe4d9;
  border-radius:8px;
}

@media(max-width:950px) {
  .site-admin-workspace {
    grid-template-columns:minmax(0,1fr) 300px;
    gap:22px;
    padding:24px 20px;
  }

  .workspace-brand>strong,.workspace-brand-divider {
    display:none;
  }

  .site-admin-cover-card {
    gap:12px;
  }

  .site-admin-cover-card .site-admin-hero {
    width:90px;
    height:78px;
  }

}

@media(max-width:700px) {
  .builder-shell .topbar,.site-admin-topbar {
    padding:12px 16px;
    flex-wrap:wrap;
    position:relative;
  }

  .builder-shell .topbar-actions {
    width:auto;
    margin-left:auto;
    display:flex;
  }

  .builder-shell .topbar-actions button {
    font-size:11px;
    padding:8px 10px;
  }

  .builder-shell .entitlement-badge {
    display:none;
  }

  .builder-shell #builderProjectName {
    max-width:180px;
  }

  .builder-shell .preview-panel {
    padding:12px;
  }

  .builder-shell .workspace-tools {
    gap:0;
  }

  .builder-shell .workspace-tools button {
    padding:7px 9px;
    font-size:11px;
    min-height:42px;
  }

  .builder-shell #previewDeviceButton {
    display:none;
  }

  .builder-shell .preview-edit-toolbar {
    flex-wrap:nowrap;
    gap:3px;
  }

  .builder-shell .preview-toolbar {
    font-size:10px;
  }

  .builder-shell .preview-panel iframe {
    min-height:450px;
    height:calc(100dvh - 220px);
  }

  .builder-shell .preview-edit-hint {
    font-size:10px;
  }

  .workspace-status {
    gap:0;
  }

  .workspace-status>section {
    min-width:100%;
  }

  .builder-empty-state {
    padding:65px 22px;
  }

  .builder-empty-state h1 {
    font-size:27px;
  }

  .builder-empty-state p {
    font-size:12px;
  }

  .editor-drawer {
    inset:auto 0 0;
    margin:0;
    width:100%;
    height:auto;
    max-height:85dvh;
    border-radius:18px 18px 0 0;
  }

  .editor-drawer::backdrop {
    background:#18201755;
  }

  .builder-shell .editor-panel {
    padding:0 20px calc(20px + env(safe-area-inset-bottom));
  }

  .site-admin-workspace {
    display:block;
    padding:24px 16px 40px;
  }

  .site-admin-preview {
    display:none;
    position:static;
  }

  .site-admin-workspace[data-view=effect] .site-admin-panel {
    display:none;
  }

  .site-admin-workspace[data-view=effect] .site-admin-preview {
    display:block;
  }

  .site-admin-view-tabs {
    display:flex;
    background:var(--editor-paper);
    border-bottom:1px solid var(--editor-line);
  }

  .site-admin-view-tabs button {
    width:50%;
    min-height:46px;
    border:0;
    border-bottom:2px solid transparent;
    background:transparent;
    font-size:12px;
    color:var(--editor-muted);
  }

  .site-admin-view-tabs button[aria-pressed=true] {
    border-color:#355344;
    color:#355344;
  }

  .site-admin-library-header h1 {
    font-size:24px;
  }

  .site-admin-library-header p {
    font-size:11px;
  }

  .site-admin-library-header .site-admin-upload {
    padding:10px 12px;
  }

  .site-admin-cover-card .site-admin-hero {
    width:88px;
    height:72px;
  }

  .site-admin-cover-copy h2 {
    font-size:12px;
  }

  .site-admin-cover-copy p {
    font-size:10px;
  }

  .site-admin-actions .site-admin-button.secondary {
    display:inline-flex;
  }

  .site-admin-brand {
    gap:10px;
  }

  .site-admin-brand strong {
    font-size:13px;
  }

  .site-admin-domain {
    font-size:10px;
    overflow-wrap:anywhere;
  }

  .site-admin-topbar {
    gap:10px;
  }

  .site-admin-preview iframe {
    height:calc(100dvh - 180px);
  }

  #siteAdminPhotoGrid {
    height:58dvh;
    min-height:320px;
  }

  .site-admin-selection-bar {
    bottom:calc(12px + env(safe-area-inset-bottom));
  }

  .site-admin-selection-bar .site-admin-inline {
    gap:4px;
  }

  .site-admin-selection-bar .site-admin-button {
    padding:8px 10px;
  }

  .site-admin-dialog {
    padding:18px;
  }

  .site-admin-topbar .site-admin-actions {
    margin-left:auto;
  }

}

@media(prefers-reduced-motion:reduce) {
  .builder-shell *,.site-admin-shell * {
    scroll-behavior:auto!important;
    transition:none!important;
  }

}
