.project-draft-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 44px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(242,232,213,.1);
  border-radius: 12px;
  background: #1b1b1b;
  color: var(--text);
  font: 600 12px var(--font-ui, sans-serif);
  cursor: pointer;
}
#preview-bar-title .preview-title-main {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.selector-icon {
  display: block;
  flex: none;
  width: 22px;
  height: 22px;
  pointer-events: none;
}
.selector-icon use { fill: currentColor; stroke: none; }
html:not(.sd-phone-mode) body #hdr #hdr-actions-group > :is(#draft-workspace-tab,.export-btn).hdr-btn {
  display: inline-flex !important;
  flex: 0 0 44px !important;
  align-items: center !important;
  justify-content: center !important;
  width: 44px !important;
  min-width: 44px !important;
  height: 42px !important;
  padding: 0 !important;
  margin: 0 !important;
}
/* Give Editor and Exports the same separation as the Drafts and Layers selectors. */
html:not(.sd-phone-mode) body #hdr #hdr-actions-group > #draft-workspace-tab.hdr-btn {
  margin-inline-end: calc(var(--sd-header-selector-gap) - var(--sd-header-utility-gap)) !important;
}
#hdr #hdr-actions-group .export-btn::after { display: none !important; }
#hdr .export-btn > .selector-icon { color: #fff; }
#hdr .export-btn:is(:hover, :focus-visible, [aria-expanded="true"]) > .selector-icon {
  color: rgb(var(--button-amber-rgb));
}
html body #hdr #hdr-actions-group > :is(#draft-workspace-tab,.export-btn).hdr-btn:focus-visible,
html.sd-phone-mode body #hdr #mobile-drafts-btn:focus-visible,
html body #preview-bar button[aria-label="Export"]:focus-visible {
  outline: 2px solid var(--accent) !important;
  outline-offset: 2px !important;
}
html:not(.sd-phone-mode) body #hdr #layer-tabs-left {
  flex: 0 0 44px !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
}
html:not(.sd-phone-mode) body #hdr #layer-dropdown-toggle {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 !important;
}
#hdr #layer-dropdown-toggle::after,
#hdr #layer-dropdown-label[hidden] {
  display: none !important;
}
.project-draft-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.project-draft-toggle:is(:hover, :focus-visible, [aria-expanded="true"]) {
  border-color: var(--accent);
  color: var(--accent);
}
#preview-bar-title { display: flex; align-items: center; gap: 10px; }
#preview-bar-title .project-draft-toggle { width: 36px; height: 32px; }
#project-draft-menu, #project-draft-dialog {
  box-sizing: border-box;
  color: var(--text, #f2e8d5);
  background: #1b1b1b;
  border: 1px solid rgba(242,232,213,.17);
  border-radius: 12px;
  box-shadow: 0 14px 40px #0009;
  font: 14px/1.45 var(--font-ui, sans-serif);
}
#project-draft-menu {
  --draft-label-inset: 12px;
  position: fixed;
  z-index: 2147483600;
  width: min(190px, calc(100vw - 16px));
  padding: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
#project-draft-menu button, #project-draft-menu summary {
  width: 100%;
  min-height: 42px;
  border-radius: 6px;
  padding: 8px var(--draft-label-inset);
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
#project-draft-menu button { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
#project-draft-menu button > span:first-child { min-width: 0; overflow-wrap: anywhere; }
#project-draft-menu button > span:last-child { color: var(--accent); }
#project-draft-menu button[aria-current="true"] { background: var(--sd-button-selected); }
#project-draft-menu :is(summary, button):is(:hover, :focus-visible):not(:disabled) { background: var(--sd-button-hover); }
#project-draft-menu button:disabled { opacity: .45; cursor: default; }
#project-draft-menu hr { margin: 5px; border: 0; border-top: 1px solid rgba(242,232,213,.14); }
#project-draft-archives { margin-top: 4px; }
#project-draft-archives summary {
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
  color: var(--muted);
}
#project-draft-archives summary::-webkit-details-marker { display: none; }
#project-draft-archives summary::before {
  content: "";
  flex: none;
  border-block: 4px solid transparent;
  border-left: 6px solid currentColor;
}
#project-draft-archives[open] summary::before { transform: rotate(90deg); }
#project-draft-archive-list > hr:first-child { visibility: hidden; }
#project-draft-archive-list .archived-draft-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 3px;
  padding: 3px 0;
}
html body #project-draft-archive-list button { min-height: 32px; padding: 0; }
html body #project-draft-archive-list .archived-draft-name {
  padding-inline: var(--draft-label-inset) 6px;
  min-width: 0;
  background: transparent;
  box-shadow: none;
}
#project-draft-archive-list button.archived-draft-name > span:only-child {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: inherit;
}
#project-draft-archive-list .archived-draft-action { width: 32px; justify-content: center; }
#project-draft-archive-list .archived-draft-action[title="Delete"] { color: #ffb7a3; }
.archived-name-hint {
  grid-column: 1 / -1;
  padding: 4px 6px;
  color: var(--text);
  overflow-wrap: anywhere;
}
html.sd-phone-mode body #project-draft-archive-list button { min-height: 44px; }
html.sd-phone-mode #project-draft-archive-list .archived-draft-action { width: 44px; }
#project-draft-dialog .modal-note { overflow-wrap: anywhere; }
#project-draft-demo-note { color: var(--muted); margin: 4px 12px; font-size: 12px; }
#project-draft-dialog { width: min(390px, calc(100vw - 30px)); margin: auto; padding: 22px; }
#project-draft-dialog::backdrop { background: rgba(0,0,0,.66); }
#project-draft-dialog fieldset { padding: 0; margin: 0; min-width: 0; border: 0; }
#project-draft-dialog h2 { margin: 0 0 12px; font: 600 21px var(--font-reading, serif); }
#project-draft-dialog .modal-note { margin: 0 0 16px; color: #c9bfad; font: inherit; }
#project-draft-dialog label { display: grid; gap: 5px; margin: 12px 0; font-size: 13px; }
#project-draft-dialog :is(input, select) {
  width: 100%; padding: 9px 11px; border-radius: 7px; border: 1px solid #55514b;
  color: inherit; background: #121212; font: inherit;
}
#project-draft-dialog select {
  appearance: none;
  box-sizing: border-box;
  min-width: 0;
  padding-inline-end: 36px;
  text-overflow: ellipsis;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16'%3E%3Cpath d='m3 6 5 5 5-5' fill='none' stroke='%23f2e8d5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
}
@media (forced-colors: active) {
  #project-draft-dialog select { appearance: auto; background-image: none; }
}
#project-draft-dialog [role="alert"] { color: #ffb7a3; }
#project-draft-dialog [role="alert"]:empty { display: none; }
#project-draft-dialog .modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
#project-draft-dialog button {
  border: 1px solid #545049; border-radius: 7px; padding: 8px 15px;
  color: inherit; background: transparent; font: inherit; cursor: pointer;
}
#project-draft-dialog button[type="submit"] { background: var(--accent); border-color: transparent; color: #14110e; }
#project-draft-dialog fieldset:disabled button {
  background: var(--sd-button-selected);
  border-color: #514e49;
  color: #b8b2a8;
  cursor: wait;
}
#project-draft-dialog [role="status"]:empty { display: none; }
#project-draft-dialog [role="status"] { display: flex; align-items: center; gap: 9px; }
#project-draft-dialog [role="status"]::before {
  content: '';
  width: 14px;
  height: 14px;
  flex: none;
  border: 2px solid #61584c;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: draft-progress-spin .85s linear infinite;
}
@keyframes draft-progress-spin { to { transform: rotate(1turn); } }
@media (prefers-reduced-motion: reduce) {
  #project-draft-dialog [role="status"]::before { animation: none; }
}
.project-draft-toggle[hidden], #project-draft-menu[hidden], #project-draft-menu [hidden], #project-draft-dialog [hidden] { display: none !important; }

@media (min-width: 761px) and (max-width: 1180px) {
  html:not(.sd-phone-mode) body #hdr #proj-btn { max-width: 135px !important; }
}
@media (min-width: 761px) and (max-width: 900px) {
  html:not(.sd-phone-mode) body #hdr #proj-btn { max-width: 92px !important; padding-inline: 7px !important; }
}

html.sd-phone-mode body #hdr {
  grid-template-columns: 34px minmax(0,1fr) 44px 44px 45px 32px !important;
  padding-inline: 7px !important;
  column-gap: 3px !important;
}
html.sd-phone-mode body #hdr #logo,
html.sd-phone-mode body #hdr #logo img { width: 34px !important; min-width: 34px !important; max-width: 34px !important; }
html.sd-phone-mode body #hdr #proj-btn { padding-inline: 7px !important; }
html.sd-phone-mode body #hdr #project-draft-toggle {
  grid-area: 1 / 3; height: 40px; border-radius: 9px;
}
html.sd-phone-mode body #hdr #layer-tabs-left { grid-column: 4 !important; }
html.sd-phone-mode body #hdr :is(#layer-tabs-left, #layer-dropdown-toggle) { width: 44px !important; }
html.sd-phone-mode body #hdr #mobile-drafts-btn { grid-column: 5 !important; width: 45px !important; }
html.sd-phone-mode body #hdr #hamburger-btn { grid-column: 6 !important; min-width: 32px !important; width: 32px !important; }
html.sd-phone-mode body #preview-bar-title {
  display: flex !important; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px;
}
html.sd-phone-mode body #preview-bar-title .preview-title-main { max-width: 100%; }
html.sd-phone-mode body #preview-bar-title .project-draft-toggle { width: 36px; height: 30px; }
html.sd-phone-mode #project-draft-menu :is(button, summary) { min-height: 46px; }
