/* SVG workspace only. Global navigation, footer and other templates retain their theme styles. */
.bl-studio-page {
  /* background: linear-gradient(180deg, #f8faff 0, #fff 350px); */
  color: #101c34;
  padding-bottom: 30px;
}
.bl-page-shell {
  width: calc(100% - 64px);
  max-width: 1440px;
  margin: 0 auto;
}

.bl-page-heading {
  margin: 6px 0 26px;
}
.bl-page-heading h1 {
  font-size: clamp(24px, 2.5vw, 34px);
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.7px;
  margin: 0 0 10px;
}

.bl-support-banner {
  text-align: center;
}
.bl-unavailable {
  padding: 30px;
  border: 1px solid #e3e8f0;
  border-radius: 14px;
  background: #fff;
}
.bl-unavailable p {
  margin: 0 0 12px;
}
.bl-svg-tool {
  --bl-blue: #0866ff;
  --bl-line: #e2e8f2;
  --bl-ink: #101c34;
  --bl-svg-btn-bg: #fca120;
  color: var(--bl-ink);
  font-size: 14px;
  line-height: 1.5;
  min-width: 0;
}
.bl-svg-tool * {
  box-sizing: border-box;
}
.bl-svg-tool [hidden] {
  display: none !important;
}
.bl-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.9fr) minmax(330px, 1fr);
  gap: 24px;
  align-items: start;
}
.bl-preview-column,
.bl-tools-column {
  min-width: 0;
}
.bl-tools-column {
  display: block;
}
.bl-card {
  border: 1px solid var(--bl-line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 2px 4px #152b4810;
  overflow: hidden;
}
.bl-preview-card {
  padding: 18px;
}
.bl-preview-top,
.bl-view-controls,
.bl-zoom {
  display: flex;
  align-items: center;
  gap: 8px;
}
.bl-preview-top {
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.bl-view-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--bl-blue);
  background: #edf3ff;
  border: 1px solid #d6e3ff;
  border-radius: 9px;
  padding: 10px 12px;
  font-weight: 600;
  min-height: 44px;
}
.bl-svg-tool svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  display: block;
}
.bl-svg-tool button,
.bl-svg-tool input[type="number"],
.bl-svg-tool input[type="text"] {
  font: inherit;
  line-height: 1.3;
  border: 1px solid #d7dfec;
  border-radius: 9px;
  padding: 10px 12px;
  background: #fff;
  color: var(--bl-ink);
  min-height: 44px;
  max-width: 100%;
}
.bl-svg-tool button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 1px 2px #1a36500a;
  font-size: 0.8rem;
  transition:
    background 0.15s,
    border-color 0.15s;
}
.bl-svg-tool button:disabled {
  opacity: 0.45;
  cursor: default;
  box-shadow: none;
}
.bl-svg-tool button:hover:enabled {
  background: #f2f6ff;
  border-color: #a7bfe9;
}
.bl-svg-tool button[aria-pressed="true"] {
  color: var(--bl-blue);
  border-color: var(--bl-blue);
  background: #f3f7ff;
  box-shadow: 0 0 0 2px #0055ec08;
}
.bl-svg-tool button.bl-primary {
  background: var(--bl-blue);
  color: #fff;
  border-color: var(--bl-blue);
  font-weight: 600;
  box-shadow: 0 3px 7px #0055ec18;
}
.bl-svg-tool button.bl-primary:hover:enabled {
  background: #0045c2;
}
.bl-svg-tool button.is-loading {
  cursor: wait;
}
.bl-svg-tool button.is-loading:before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: bl-spin 0.8s linear infinite;
}
.bl-zoom {
  gap: 0;
}
.bl-zoom button:first-child {
  border-radius: 9px 0 0 9px;
}

.bl-zoom output {
  min-width: 58px;
  padding: 11px 6px;
  text-align: center;
  border-top: 1px solid #d7dfec;
  border-bottom: 1px solid #d7dfec;
  line-height: 20px;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.bl-stage {
  height: clamp(350px, 33vw, 530px);
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background-color: #fff;
  background-image: conic-gradient(#eef0f3 25%, transparent 0 50%, #eef0f3 0 75%, transparent 0);
  background-size: 20px 20px;
  overscroll-behavior: contain;
}
.bl-art {
  width: 85%;
  height: 85%;
  flex-shrink: 0;
}
.bl-art > img,
.bl-art > noscript img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain;
}

.bl-segments {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.bl-segments button {
  font-size: 12px;
  padding: 8px;
  min-height: 38px;
  gap: 6px;
}
.bl-swatch {
  display: inline-block;
  width: 17px;
  height: 17px;
  border: 1px solid #d5dce7;
  border-radius: 4px;
  flex-shrink: 0;
}
.bl-checker {
  background: conic-gradient(#bbc6db 25%, #fff 0 50%, #bbc6db 0 75%, #fff 0);
  background-size: 10px 10px;
}
.bl-white {
  background: #fff;
}
.bl-black {
  background: #000;
}
.bl-rainbow {
  background: conic-gradient(#ed4747, #f5dd38, #37be7c, #4883f1, #bb42e3, #ed4747);
  border-radius: 50%;
}
.bl-svg-tool label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.bl-include {
  font-size: 12px;
  min-height: 38px;
  margin-left: auto;
}
.bl-svg-tool input[type="checkbox"] {
  accent-color: var(--bl-blue);
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin: 0;
}
.bl-svg-tool input[type="color"] {
  width: 40px;
  height: 40px;
  border: 1px solid #d7dfec;
  border-radius: 8px;
  padding: 4px;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.bl-svg-tool input[type="number"] {
  width: 100%;
  margin-top: 10px;
}
.bl-svg-tool input[aria-invalid="true"] {
  border-color: #c63f35;
  outline: 1px solid #c63f35;
}
.bl-help,
.bl-caption {
  font-size: 0.8rem;
  line-height: 1.6;
  color: #441435c2;
  margin: 10px 0 0;
}

.bl-card-heading {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 17px 20px;
  border-bottom: 1px solid var(--bl-line);
  gap: 10px;
}

.bl-badge {
  font-size: 12px;
  color: #61728c;
  white-space: nowrap;
  border-radius: 20px;
  padding: 6px 10px;
  background: #f1f4f9;
}
.bl-badge.is-edited {
  background: #eaf7ef;
  color: #257448;
}

.bl-svg-tool h2 {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 600;
  margin: 0;
}

.bl-svg-tool [data-editor] {
  padding: 18px 20px;
  scroll-margin-top: 20px;
}
.bl-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.bl-section-heading button {
  font-size: 11px;
  padding: 7px 9px;
  min-height: 34px;
}
.bl-palette {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  max-height: 260px;
  overflow: auto;
  padding: 3px;
  overscroll-behavior: contain;
}
.bl-color {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  border: 1px solid var(--bl-line);
  border-radius: 10px;
  padding: 6px;
}
.bl-color input[type="text"] {
  flex: 1;
  min-width: 0;
  width: 95px;
  border: 0;
  box-shadow: none;
  font-family: monospace;
  font-size: 13px;
  padding: 7px 3px;
  text-transform: uppercase;
}
.bl-color input[type="color"] {
  border: 0;
  width: 42px;
  height: 42px;
  padding: 2px;
}
.bl-color button {
  font-size: 11px;
  min-height: 36px;
  padding: 7px 10px;
}
.bl-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.bl-history button {
  font-size: 12px;
  padding: 7px 12px;
  min-height: 36px;
}
.bl-export {
  padding: 20px;
}

.bl-svg-tool .bl-download {
  width: 100%;
  min-height: 48px;
  font-size: 14px;
  margin-top: 14px;
}

.bl-svg-tool [data-status] {
  font-size: 12px;
  line-height: 1.65;
  padding: 12px 14px;
  color: #586b86;
  background: #f1f5fc;
  border: 1px solid #e2e8f2;
  border-radius: 10px;
  margin: 0;
  overflow-wrap: anywhere;
}
.bl-svg-tool [data-status]:empty {
  display: none;
}
.bl-svg-tool [data-status][data-kind="error"] {
  background: #fff3f1;
  color: #a52822;
  border-color: #f1c9c4;
}
.bl-svg-tool :focus-visible {
  outline: 2px solid #2671ef;
  outline-offset: 3px;
}
.bl-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.bl-expanded-preview {
  width: calc(100vw - 48px);
  max-width: 1500px;
  height: calc(100dvh - 48px);
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: #fff;
  overflow: auto;
  color: var(--bl-ink);
}
.bl-expanded-preview::backdrop {
  background: #12223bc7;
  backdrop-filter: blur(3px);
}
.bl-expanded-preview .bl-preview-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  border: 0;
  border-radius: 0;
}
.bl-expanded-preview .bl-stage {
  flex: 1;
  height: 0;
  min-height: 100px;
}
@keyframes bl-spin {
  to {
    transform: rotate(360deg);
  }
}
@media (prefers-reduced-motion: reduce) {
  .bl-svg-tool button {
    transition: none;
  }
  .bl-svg-tool button.is-loading:before {
    animation: none;
  }
}
@media (min-width: 1600px) {
  .bl-stage {
    height: 530px;
  }
}
@media (max-width: 1050px) {
  .bl-page-shell {
    width: calc(100% - 40px);
  }
  .bl-workspace {
    grid-template-columns: minmax(0, 1.4fr) minmax(310px, 1fr);
    gap: 18px;
  }
  .bl-preview-card {
    padding: 14px;
  }
  .bl-preview-top {
    gap: 12px;
  }
  .bl-include {
    margin-left: 0;
  }
  .bl-zoom button {
    min-height: 40px;
  }
  .bl-zoom output {
    padding: 9px 4px;
  }
  .bl-stage {
    height: 390px;
  }
}
@media (max-width: 800px) {
  .bl-workspace {
    grid-template-columns: 1fr;
  }
  .bl-stage {
    height: 370px;
  }

  .bl-tools-column {
    gap: 16px;
  }

  .bl-preview-card {
    padding: 14px;
  }

  .bl-palette {
    max-height: 245px;
  }
  .bl-view-label {
    font-size: 13px;
  }
}
@media (max-width: 480px) {
  .bl-page-shell {
    width: calc(100% - 28px);
  }
  .bl-page-heading {
    margin-bottom: 20px;
  }
  .bl-page-heading h1 {
    font-size: 25px;
  }

  .bl-preview-card {
    padding: 12px;
  }
  .bl-preview-top {
    gap: 10px;
  }
  .bl-view-controls {
    gap: 6px;
  }
  .bl-view-controls > button,
  .bl-view-label {
    font-size: 12px;
    padding: 9px;
  }
  .bl-zoom button {
    padding: 6px 9px;
    min-height: 38px;
  }
  .bl-zoom output {
    min-width: 45px;
    padding: 8px 3px;
  }
  .bl-zoom svg {
    width: 17px;
    height: 17px;
  }
  .bl-stage {
    height: 275px;
  }

  .bl-segments {
    gap: 5px;
  }
  .bl-segments button {
    font-size: 11px;
    min-height: 40px;
  }
  .bl-include {
    min-height: 40px;
  }

  .bl-svg-tool input[type="text"],
  .bl-svg-tool input[type="number"] {
    font-size: 16px;
  }
  .bl-card-heading,
  .bl-export {
    padding: 16px;
  }
  .bl-svg-tool [data-editor] {
    padding: 16px;
  }

  .bl-page-heading h1 {
    letter-spacing: -0.4px;
  }
}

.bl-card-heading:after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 18px;
  width: 140px;
  height: 2px;
  background: var(--bl-blue);
  border-radius: 2px;
}

/* Download first; quick customization is one self-contained flow. */
.bl-original-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  margin-bottom: 22px;
  border: 1px solid #d9e5fb;
  border-radius: 14px;
  background: linear-gradient(110deg, #edf4ff, #fff);
  box-shadow: 0 2px 4px #152b4808;
}
.bl-original-bar > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.bl-original-bar strong {
  font-size: 17px;
  font-weight: 650;
}
.bl-original-bar span {
  font-size: 13px;
  color: #60718c;
}
.bl-original-bar button {
  min-height: 48px;
  padding: 12px 22px;
  font-size: 15px;
  white-space: nowrap;
}
.bl-quick-card .bl-card-heading {
  padding: 17px 20px;
}

.bl-quick-card .bl-card-heading:after {
  display: none;
}
.bl-quick-body {
  padding: 18px 20px;
}
.bl-quick-body h3 {
  font-size: 16px;
  font-weight: 650;
  margin: 0;
}
.bl-quick-body [data-editor] {
  padding: 0;
  scroll-margin-top: 0;
}
.bl-quick-section + .bl-quick-section {
  border-top: 1px solid var(--bl-line);
  padding-top: 16px;
  margin-top: 16px;
}
.bl-section-heading .bl-text-button {
  min-height: 30px;
  border: 0;
  box-shadow: none;
  background: transparent;
  color: #586d8f;
  font-size: 12px;
  padding: 4px 6px;
}

.bl-quick-body .bl-color input[type="text"] {
  min-height: 36px;
}

.bl-background-buttons {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
  margin-top: 10px;
}
.bl-background-buttons button {
  padding: 8px 4px;
  font-size: 11px;
  min-height: 40px;
  gap: 5px;
}
.bl-background-buttons .bl-swatch {
  width: 18px;
  height: 18px;
}
.bl-quick-body .bl-include {
  width: 100%;
  margin: 8px 0 0;
  min-height: 40px;
  padding: 8px 0;
  border: 0;
  font-size: 0.8rem;
  line-height: 1.4;
  color: #718096;
}
.bl-quick-body .bl-include.is-available {
  color: var(--bl-blue);
  cursor: pointer;
}
.bl-quick-body [data-background-color] {
  display: block;
  margin-top: 8px;
}
.bl-quick-body [data-background-help] {
  font-size: 0.85rem;
  margin-top: 2px;
}

.bl-preview-caption {
  font-size: 11px;
  color: #7d8ba0;
  margin: 12px 0 0;
  text-align: center;
}

.bl-advanced-panel {
  padding: 12px;
  border: 1px solid #d9e5fb;
  border-radius: 9px;
  background: #f7faff;
  margin-top: 12px;
}
.bl-advanced-panel h3 {
  font-size: 13px;
}

.bl-quick-body [data-color-loading] {
  margin: 0;
  padding: 12px 0;
}
.bl-quick-body [data-retry] {
  font-size: 12px;
  margin-top: 8px;
  min-height: 36px;
}
@media (min-width: 801px) {
  .bl-preview-column {
    position: sticky;
    top: 16px;
  }
  .admin-bar .bl-preview-column {
    top: 48px;
  }
}
@media (max-width: 800px) {
  .bl-original-bar {
    padding: 16px;
    margin-bottom: 16px;
  }
  .bl-original-bar button {
    font-size: 13px;
    padding: 10px 14px;
  }
  .bl-original-bar strong {
    font-size: 15px;
  }
  .bl-original-bar span {
    font-size: 12px;
  }
  .bl-preview-column {
    position: sticky;
    top: 8px;
    z-index: 3;
  }
  .admin-bar .bl-preview-column {
    top: 54px;
  }
  .bl-stage {
    height: 210px;
  }
  .bl-preview-caption {
    display: none;
  }
  .bl-preview-top {
    margin-bottom: 10px;
  }
  .bl-workspace {
    gap: 16px;
  }
  .bl-preview-card {
    box-shadow: 0 4px 14px #152b4812;
  }
  .bl-quick-body .bl-palette {
    max-height: 200px;
  }

  .bl-quick-body [data-color-index] {
    scroll-margin-top: 350px;
  }
}
@media (max-width: 480px) {
  .bl-original-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .bl-original-bar > div {
    flex-direction: row;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
  }
  .bl-original-bar button {
    width: 100%;
    min-height: 46px;
    font-size: 14px;
  }
  .bl-quick-body,
  .bl-quick-card .bl-card-heading {
    padding: 16px;
  }
  .bl-stage {
    height: 170px;
  }
  .bl-quick-body .bl-color input[type="text"] {
    font-size: 16px;
  }
  .bl-background-buttons button {
    font-size: 12px;
    min-height: 44px;
  }
  .bl-quick-body .bl-include {
    min-height: 40px;
  }
  .bl-quick-body [data-editor] {
    padding: 0;
  }
}
@media (max-height: 560px) and (max-width: 800px) {
  .bl-preview-column {
    position: static;
  }
}

/* Two colors per row; compact, direct PNG / SVG downloads. */
.bl-quick-body .bl-palette {
  max-height: 180px;
  padding: 3px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.bl-quick-body .bl-color {
  padding: 4px;
  gap: 4px;
  min-width: 0;
}
.bl-quick-body .bl-color input[type="color"] {
  width: 28px;
  height: 36px;
  padding: 2px;
  min-width: 28px;
}
.bl-quick-body .bl-color input[type="text"] {
  width: 70px;
  min-width: 0;
  padding: 4px 0;
  font-size: 13px;
}
.bl-quick-body .bl-color button {
  min-height: 36px;
  padding: 5px;
  width: 28px;
  min-width: 28px;
  border: 0;
  box-shadow: none;
  flex-shrink: 0;
}
.bl-quick-body .bl-color button svg {
  width: 16px;
  height: 16px;
}
.bl-quick-body .bl-background-buttons button {
  font-size: 12px;
  color: #42536d;
}
.bl-download-row {
  display: grid;
  grid-template-columns: minmax(0, 65fr) minmax(0, 35fr);
  gap: 10px;
  margin-top: 12px;
}
.bl-png-split {
  display: flex;
  min-width: 0;
  background: var(--bl-blue);
  border: 1px solid var(--bl-blue);
  border-radius: 9px;
  overflow: hidden;
}
.bl-svg-tool .bl-png-split > button {
  flex: 1;
  min-width: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  font-weight: 650;
  min-height: 48px;
  padding: 10px;
  box-shadow: none;
}
.bl-svg-tool .bl-png-split > button:hover:enabled {
  background: #0045c2;
}
.bl-svg-tool .bl-svg-download {
  min-height: 50px;
  background: var(--bl-svg-btn-bg);
  border-color: transparent;
  color: #fff;
  font-size: 15px;
  font-weight: 650;
  gap: 8px;
}
.bl-download-svg-icon {
  display: block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.bl-svg-tool .bl-svg-download:hover:enabled {
  background: #f3920a;
  border-color: transparent;
}
@media (max-width: 480px) {
  .bl-quick-body .bl-color input[type="text"] {
    font-size: 16px;
  }
  .bl-quick-body .bl-background-buttons button {
    font-size: 13px;
  }
  .bl-download-row {
    gap: 8px;
  }

  .bl-svg-tool .bl-png-split > button {
    padding: 8px;
    font-size: 14px;
  }
}
@media (max-width: 360px) {
  .bl-quick-body .bl-color {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 2px;
  }
  .bl-quick-body .bl-color input[type="text"] {
    grid-column: 1/-1;
    grid-row: 2;
    width: 100%;
    text-align: center;
  }
  .bl-quick-body .bl-color button {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
  }
  .bl-svg-tool .bl-svg-download {
    gap: 5px;
  }
}

/* Keep the native picker rendered at Custom so its popup has a real anchor. */
.bl-custom-background {
  position: relative;
  display: block;
  min-width: 0;
}
.bl-custom-background > button {
  width: 100%;
  height: 100%;
}
.bl-quick-body .bl-custom-background > input[data-background-color] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: auto;
}

/* Stage actions stay in the header; zoom remains anchored outside the scrolling art. */
.bl-stage-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.bl-svg-tool .bl-stage-edit {
  gap: 8px;
  font-size: 14px;
  white-space: nowrap;
}
.bl-edit-icon {
  display: block;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}
.bl-stage-shell {
  position: relative;
  min-height: 0;
}
.bl-stage-zoom {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 1;
}
.bl-svg-tool .bl-stage-zoom button {
  width: 42px;
  height: 42px;
  min-height: 42px;
  margin: 0;
  padding: 0;
  border: 1px solid #d5dfed;
  border-radius: 9px;
  background: #fffffff2;
  box-shadow: 0 2px 5px #1b32521a;
  font-size: 24px;
}
.bl-stage-zoom output.bl-sr-only {
  min-width: 0;
  padding: 0;
  border: 0;
}
.bl-expanded-preview .bl-stage-shell {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.bl-expanded-preview .bl-stage {
  flex: 1;
  min-height: 100px;
}
@media (max-width: 480px) {
  .bl-stage-actions {
    gap: 6px;
  }
  .bl-svg-tool .bl-stage-edit {
    font-size: 12px;
    padding: 8px;
    gap: 6px;
  }
  .bl-edit-icon {
    width: 20px;
    height: 20px;
  }
  .bl-stage-zoom {
    right: 8px;
    bottom: 8px;
    gap: 5px;
  }
  .bl-svg-tool .bl-stage-zoom button {
    width: 36px;
    height: 36px;
    min-height: 36px;
  }
}

/* One active panel at a time, with shared customization state. */
.bl-quick-card .bl-mode-heading {
  padding: 10px 12px;
  gap: 8px;
  flex-wrap: wrap;
}
.bl-mode-tabs {
  display: flex;
  flex: 1;
  gap: 4px;
  min-width: 0;
}
.bl-svg-tool .bl-mode-tabs > button {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 10px 5px;
  font-size: 0.9rem;
  line-height: 1.4;
  background: transparent;
  box-shadow: none;
  white-space: nowrap;
}
.bl-svg-tool .bl-mode-tabs > button[aria-selected="true"] {
  background: #edf4ff;
  color: var(--bl-blue);
  font-weight: 650;
}
.bl-quick-body [data-advanced].bl-advanced-panel {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.bl-advanced-panel .bl-history {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.bl-advanced-panel .bl-history > button:last-child {
  grid-column: 1/-1;
}
@media (max-width: 480px) {
  .bl-quick-card .bl-mode-heading {
    padding: 8px;
  }
  .bl-svg-tool .bl-mode-tabs > button {
    font-size: 12px;
    padding: 10px 6px;
  }
}

/* Per-element editing controls. The selection outline is never part of SVG output. */
.bl-object-label {
  display: flex !important;
  flex-direction: column;
  align-items: stretch !important;
  gap: 6px;
  margin-top: 14px;
  font-size: 12px;
  font-weight: 600;
}
.bl-advanced-panel select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 40px;
  border: 1px solid #d7dfec;
  border-radius: 8px;
  background: #fff;
  color: var(--bl-ink);
  font: inherit;
  font-size: 13px;
  padding: 8px;
}
.bl-advanced-panel [data-object-list] {
  margin-top: 6px;
}
.bl-advanced-panel fieldset {
  border: 0;
  border-top: 1px solid var(--bl-line);
  min-width: 0;
  margin: 16px 0 0;
  padding: 14px 0 0;
}
.bl-advanced-panel fieldset:disabled {
  opacity: 0.45;
}
.bl-object-paint {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 12px;
}
.bl-object-paint input[type="color"] {
  width: 42px !important;
  height: 40px;
}
.bl-object-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 14px;
}
.bl-object-pair > label,
.bl-canvas-tools > label {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
}
.bl-object-pair input[type="number"],
.bl-object-label input[type="number"] {
  margin-top: 6px;
}
.bl-object-pair input[type="range"] {
  width: 100%;
  margin: 9px 0;
  accent-color: var(--bl-blue);
}
.bl-object-pair output {
  font-size: 12px;
  font-weight: 400;
  color: #63738c;
}
.bl-advanced-panel .bl-toolbar > button {
  font-size: 12px;
  min-height: 38px;
  padding: 8px 10px;
}
.bl-advanced-panel [data-show-hidden] {
  width: 100%;
  margin-top: 12px;
  font-size: 12px;
}
.bl-canvas-tools {
  margin-top: 18px;
  border-top: 1px solid var(--bl-line);
  padding-top: 12px;
}
.bl-canvas-tools summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 12px;
}
.bl-canvas-tools > label {
  max-width: 150px;
}
.bl-selection-layer {
  position: absolute;
  pointer-events: none;
  overflow: hidden;
  z-index: 2;
}
.bl-selection-outline {
  position: absolute;
  border: 2px dashed #0055ec;
  box-shadow:
    0 0 0 1px #fff,
    inset 0 0 0 1px #fff;
  pointer-events: none;
  border-radius: 2px;
}
.bl-stage-zoom {
  z-index: 3;
}
@media (max-width: 480px) {
  .bl-advanced-panel select {
    font-size: 16px;
  }
  .bl-advanced-panel [data-part-number] {
    font-size: 16px;
  }
}
.bl-transform-tools {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--bl-line);
}
.bl-transform-tools summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
}
.bl-selection-marquee {
  position: absolute;
  border: 1px solid #0055ec;
  background: #0055ec1c;
  pointer-events: none;
  box-sizing: border-box;
}
.bl-selection-layer .bl-selection-outline[hidden],
.bl-selection-layer .bl-selection-marquee[hidden] {
  display: none !important;
}
.bl-advanced-panel input::placeholder {
  color: #77869b;
  font-size: 12px;
  font-style: italic;
}

/* Export is shared by both modes, outside the tab panels. */
.bl-shared-download {
  margin-top: 16px;
  padding: 20px;
  background: linear-gradient(180deg, #f8faff, #fff 90px);
}
.bl-download-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.bl-shared-download h2 {
  font-size: 17px;
}
.bl-shared-download .bl-download-terms {
  margin: 8px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: #edf3ff;
  font-size: 0.8rem;
  line-height: 1.6;
  color: #63738c;
}
.bl-download-terms a {
  text-decoration: underline;
  text-underline-offset: 2px;
}
.bl-tools-column > [data-status] {
  margin-top: 12px;
}
@media (max-width: 480px) {
  .bl-shared-download {
    padding: 16px;
  }
}

/* PNG sizes open below the trigger instead of the browser's native select popup. */
.bl-shared-download,
.bl-png-split {
  overflow: visible;
}
.bl-png-split > [data-png] {
  border-radius: 8px 0 0 8px !important;
}
.bl-png-size {
  position: relative;
  flex: 0 0 40%;
  min-width: 76px;
  max-width: 110px;
}
.bl-svg-tool .bl-size-trigger {
  width: 100%;
  height: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 5px;
  padding: 8px;
  border: 0;
  border-left: 1px solid #ffffff55;
  border-radius: 0 8px 8px 0;
  box-shadow: none;
  background: transparent;
  color: #fff;
  font-size: 12px;
  white-space: nowrap;
}
.bl-svg-tool .bl-size-trigger:hover:enabled {
  background: #0045c2;
  border-color: #ffffff55;
}
.bl-size-trigger svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.bl-size-trigger[aria-expanded="true"] svg {
  transform: rotate(180deg);
}
.bl-size-options {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 20;
  width: 180px;
  padding: 5px;
  border: 1px solid #d7e1ef;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 8px 24px #10274324;
}
.bl-svg-tool .bl-size-options > button {
  width: 100%;
  min-height: 40px;
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border: 0;
  border-radius: 6px;
  box-shadow: none;
  background: #fff;
  color: var(--bl-ink);
  font-size: 13px;
  text-align: left;
}
.bl-svg-tool .bl-size-options > button:hover,
.bl-svg-tool .bl-size-options > button:focus-visible {
  background: #f0f5ff;
}
.bl-svg-tool .bl-size-options > button[aria-selected="true"] {
  background: #eaf2ff;
  color: var(--bl-blue);
  font-weight: 650;
}
.bl-size-options > button[aria-selected="true"]:after {
  content: "✓";
  margin-left: 16px;
}
@media (max-width: 480px) {
  .bl-size-options {
    width: 160px;
  }
  .bl-svg-tool .bl-size-trigger {
    font-size: 12px;
    padding: 8px 6px;
  }
  .bl-svg-tool .bl-size-options > button {
    min-height: 44px;
    font-size: 14px;
  }
}
.bl-custom-size-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 12px;
}
.bl-svg-tool .bl-custom-size-row input[data-custom-size] {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 44px;
  margin: 0;
}
.bl-svg-tool [data-apply-size] {
  flex-shrink: 0;
  height: 44px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid #d7e1ef;
  border-radius: 8px;
  background: #fff;
  color: var(--bl-ink);
  font-weight: 500;
}
.bl-svg-tool [data-apply-size]:hover:enabled {
  background: #f0f5ff;
  border-color: #b8c9df;
  color: var(--bl-ink);
}
.bl-svg-tool .bl-custom-size-row input[data-custom-size]:focus + [data-apply-size]:enabled {
  background: #eaf2ff;
  border-color: var(--bl-blue);
  color: var(--bl-blue);
  box-shadow: 0 0 0 2px #0055ff12;
}
.bl-svg-tool .bl-custom-size-row input[data-custom-size]:focus {
  outline: none;
  box-shadow: none;
  border-color: var(--bl-blue);
}
.bl-svg-tool .bl-custom-size-row input[data-custom-size][aria-invalid="true"]:focus {
  border-color: #c63f35;
}
.bl-view-label.is-muted {
  opacity: 0.4;
}
.bl-svg-tool [data-expand-close] {
  font-size: 13px;
  white-space: nowrap;
}
.bl-svg-tool [data-size-pending] {
  margin: 8px 0 0;
  color: var(--bl-blue);
}

/* Page-level navigation and sharing. */
.bl-page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  /* gap: 16px; */
}
.bl-page-nav > .bl-original-link {
  min-width: 0;
  font-size: 14px;
  line-height: 1.5;
}
.bl-page-nav .share-n-modal {
  position: relative;
  width: auto;
  max-width: none;
  margin-left: auto;
  flex-shrink: 0;
}
.bl-page-nav ._sg_lg_share_btn {
  display: inline-flex;
  flex-direction: row;
  width: auto;
  max-width: none;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 44px;
  min-height: 44px;
  padding: 8px 18px;
  border: 1px solid #d7dfec;
  border-radius: 999px;
  background: #fff;
  color: #42536d;
  font-size: 0.9rem;
  cursor: pointer;
}
.bl-page-nav ._sg_lg_share_btn:hover {
  background: #edf3ff;
}
.bl-page-nav ._sg_lg_share_btn > span {
  width: auto;
  height: auto;
}
.bl-page-nav ._sg_lg_share_btn svg {
  width: 18px;
  height: 18px;
}
.bl-page-nav ._sg_share_box {
  top: calc(100% + 8px);
  right: 0;
  width: min(360px, calc(100vw - 48px));
  max-width: none;
  padding: 16px;
}
.bl-page-nav .bl-share-title {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
}
.bl-page-nav .bl-share-note {
  margin: 0 0 12px;
  font-size: 12px;
  line-height: 1.5;
  color: #63738c;
}
@media (max-width: 480px) {
  .bl-page-nav .bl-share-label {
    display: none;
  }
}

.bl-art > noscript {
  display: block;
  height: 100%;
}
.bl-art > [data-preview-loading] {
  display: grid;
  place-items: center;
  height: 100%;
}
