/* Inkloom universal Design Studio — product-aware canvas editor.
   Theme: navy + gold to match the storefront. */

.ds-root {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  flex-direction: column;
  background: #0a1626;
  color: #f4efe4;
  font-family: Aptos, "Segoe UI", Arial, sans-serif;
}

.ds-root.is-open {
  display: flex;
  animation: ds-fade 0.25s ease;
}

@keyframes ds-fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ---------- Top bar ---------- */
.ds-topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 18px;
  background: #06101d;
  border-bottom: 1px solid rgba(201, 166, 85, 0.28);
}

.ds-brand {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
  min-width: 0;
}

.ds-brand strong {
  font-family: Baskerville, "Palatino Linotype", Georgia, serif;
  font-size: 18px;
  letter-spacing: 0.02em;
}

.ds-brand span {
  color: #c9a655;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ds-topbar-spacer {
  flex: 1;
}

.ds-topbtn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(244, 239, 228, 0.22);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: #f4efe4;
  font-weight: 700;
  font-size: 13px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}

.ds-topbtn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(201, 166, 85, 0.6);
}

.ds-topbtn:active {
  transform: scale(0.97);
}

.ds-topbtn.is-primary {
  background: #c9a655;
  border-color: #c9a655;
  color: #0a1626;
}

.ds-topbtn.is-primary:hover {
  background: #e0c278;
}

.ds-topbtn.is-ghost {
  border-color: transparent;
  background: transparent;
}

.ds-topbtn[disabled] {
  opacity: 0.4;
  pointer-events: none;
}

.ds-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(244, 239, 228, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: #f4efe4;
}

.ds-icon-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.ds-icon-btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ---------- Body layout ---------- */
.ds-body {
  flex: 1;
  display: grid;
  grid-template-columns: 248px 1fr 288px;
  min-height: 0;
}

.ds-panel {
  min-height: 0;
  overflow-y: auto;
  background: #0c1a2c;
  border-right: 1px solid rgba(201, 166, 85, 0.16);
}

.ds-panel.ds-right {
  border-right: 0;
  border-left: 1px solid rgba(201, 166, 85, 0.16);
}

.ds-panel-section {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.ds-panel-title {
  margin: 0 0 12px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c9a655;
}

/* Tool rail buttons */
.ds-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.ds-tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border: 1px solid rgba(244, 239, 228, 0.14);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  color: #f4efe4;
  font-size: 12px;
  font-weight: 700;
  transition: background 0.18s ease, border-color 0.18s ease,
    transform 0.15s ease;
}

.ds-tool:hover {
  background: rgba(201, 166, 85, 0.14);
  border-color: rgba(201, 166, 85, 0.5);
  transform: translateY(-1px);
}

.ds-tool svg {
  width: 22px;
  height: 22px;
  fill: #c9a655;
}

/* Templates */
.ds-template-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.ds-template {
  border: 1px solid rgba(244, 239, 228, 0.14);
  border-radius: 8px;
  overflow: hidden;
  background: #0a1626;
  cursor: pointer;
  transition: border-color 0.18s ease, transform 0.15s ease;
}

.ds-template:hover {
  border-color: #c9a655;
  transform: translateY(-2px);
}

.ds-template-thumb {
  display: block;
  width: 100%;
  height: 74px;
  background-size: cover;
  background-position: center;
}

.ds-template span {
  display: block;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 700;
  color: #d7cdb8;
}

/* Miniature layout preview inside the picker — neutralise the generic
   label styling above so absolutely-positioned preview parts render true. */
.ds-template-mini,
.ds-template-mini span {
  padding: 0;
  margin: 0;
}
.ds-template-mini {
  font-family: Inter, Arial, sans-serif;
}

/* Palette swatches */
.ds-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ds-swatch {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.ds-swatch:hover {
  transform: scale(1.12);
  border-color: #fff;
}

/* ---------- Canvas stage ---------- */
.ds-stage {
  position: relative;
  min-height: 0;
  overflow: auto;
  display: flex;
  flex-direction: column;
  background: #0a1626 radial-gradient(
      circle at 50% 0,
      rgba(201, 166, 85, 0.08),
      transparent 60%
    );
}

.ds-surface-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 12px 16px 0;
}

.ds-surface-tab {
  padding: 7px 13px;
  border: 1px solid rgba(244, 239, 228, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: #d7cdb8;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
}

.ds-surface-tab.is-active {
  background: #c9a655;
  border-color: #c9a655;
  color: #0a1626;
}

.ds-canvas-wrap {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 30px;
}

.ds-artboard {
  position: relative;
  background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  touch-action: none;
}

/* Guides overlay */
.ds-guides {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
}

.ds-guide-bleed {
  position: absolute;
  inset: 0;
  outline: 1px dashed rgba(233, 90, 74, 0.85);
  outline-offset: -1px;
}

.ds-guide-safe {
  position: absolute;
  border: 1px dashed rgba(64, 132, 240, 0.85);
}

.ds-guide-fold {
  position: absolute;
  top: 0;
  bottom: 0;
  border-left: 1px dashed rgba(120, 120, 120, 0.9);
}

.ds-guide-label {
  position: absolute;
  padding: 2px 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(10, 22, 38, 0.7);
  border-radius: 4px;
  white-space: nowrap;
}

.ds-guide-grommet {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  border: 2px solid rgba(10, 22, 38, 0.6);
  background: rgba(255, 255, 255, 0.6);
}

.ds-guide-line {
  position: absolute;
  background: rgba(120, 120, 120, 0.5);
}

/* Elements */
.ds-el {
  position: absolute;
  box-sizing: border-box;
  cursor: move;
  user-select: none;
}

.ds-el.ds-text {
  display: flex;
  overflow: visible;
  padding: 2px;
  white-space: pre-wrap;
  word-break: break-word;
}

.ds-el.ds-text[contenteditable="true"] {
  cursor: text;
  outline: 2px solid #4084f0;
}

.ds-el.ds-qr img {
  object-fit: contain;
  background: #fff;
}

.ds-el img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.ds-el.is-selected {
  outline: 1.5px solid #4084f0;
}

.ds-handle {
  position: absolute;
  width: 11px;
  height: 11px;
  margin: -6px 0 0 -6px;
  background: #fff;
  border: 1.5px solid #4084f0;
  border-radius: 2px;
  z-index: 10;
}

.ds-handle.nw { cursor: nwse-resize; }
.ds-handle.ne { cursor: nesw-resize; }
.ds-handle.sw { cursor: nesw-resize; }
.ds-handle.se { cursor: nwse-resize; }
.ds-handle.n  { cursor: ns-resize; }
.ds-handle.s  { cursor: ns-resize; }
.ds-handle.w  { cursor: ew-resize; }
.ds-handle.e  { cursor: ew-resize; }

/* ---------- Right properties panel ---------- */
.ds-field {
  margin-bottom: 12px;
}

.ds-field > label {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 700;
  color: #b9b09a;
}

.ds-field input[type="text"],
.ds-field input[type="number"],
.ds-field textarea,
.ds-field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(244, 239, 228, 0.2);
  border-radius: 6px;
  background: #0a1626;
  color: #f4efe4;
  font: inherit;
  font-size: 13px;
}

.ds-field textarea {
  min-height: 64px;
  resize: vertical;
}

.ds-field input[type="color"] {
  width: 100%;
  height: 38px;
  padding: 2px;
  border: 1px solid rgba(244, 239, 228, 0.2);
  border-radius: 6px;
  background: #0a1626;
}

.ds-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.ds-btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ds-mini {
  flex: 1;
  min-width: 64px;
  padding: 8px;
  border: 1px solid rgba(244, 239, 228, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.04);
  color: #f4efe4;
  font-size: 12px;
  font-weight: 700;
}

.ds-mini:hover {
  background: rgba(201, 166, 85, 0.16);
  border-color: rgba(201, 166, 85, 0.5);
}

.ds-mini.is-active {
  background: #c9a655;
  border-color: #c9a655;
  color: #0a1626;
}

.ds-mini.is-danger:hover {
  background: rgba(233, 90, 74, 0.2);
  border-color: rgba(233, 90, 74, 0.7);
}

.ds-empty-hint {
  margin: 0;
  color: #8b93a0;
  font-size: 13px;
  line-height: 1.5;
}

/* Layers list */
.ds-layer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 6px;
  cursor: pointer;
  font-size: 12px;
}

.ds-layer:hover {
  background: rgba(255, 255, 255, 0.08);
}

.ds-layer.is-selected {
  border-color: #4084f0;
  background: rgba(64, 132, 240, 0.12);
}

.ds-layer svg {
  width: 15px;
  height: 15px;
  fill: #c9a655;
  flex: 0 0 auto;
}

.ds-layer span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Spec/info line */
.ds-specline {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  padding: 4px 16px 12px;
  color: #9aa4b2;
  font-size: 12px;
}

.ds-specline strong {
  color: #d7cdb8;
}

/* Toast */
.ds-toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 20px;
  border-radius: 8px;
  background: #c9a655;
  color: #0a1626;
  font-weight: 800;
  font-size: 13px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
}

.ds-toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.ds-hidden {
  display: none !important;
}

/* Kid-simple calendar toolbar */
.ds-calbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  padding: 10px 16px;
  margin-bottom: 6px;
  background: rgba(201, 166, 85, 0.1);
  border: 1px solid rgba(201, 166, 85, 0.28);
  border-radius: 12px;
}

.ds-calgroup {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ds-callabel {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #c9a655;
}

.ds-calstep {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(201, 166, 85, 0.4);
  background: rgba(255, 255, 255, 0.06);
  color: #f4ede0;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  line-height: 1;
}

.ds-calstep:hover {
  background: rgba(201, 166, 85, 0.22);
}

.ds-calyear {
  min-width: 56px;
  text-align: center;
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.ds-calbtn {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: #c9a655;
  color: #0a1626;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.ds-calbtn.is-ghost {
  background: transparent;
  border-color: rgba(201, 166, 85, 0.45);
  color: #f4ede0;
}

.ds-calbtn:hover {
  transform: translateY(-1px);
}

.ds-caltheme {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.25);
  cursor: pointer;
  padding: 0;
}

.ds-caltheme.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 2px #c9a655;
}

.ds-calselect {
  padding: 7px 10px;
  border-radius: 8px;
  border: 1px solid rgba(201, 166, 85, 0.4);
  background: rgba(255, 255, 255, 0.06);
  color: #f4ede0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.ds-calselect option {
  color: #17212b;
}

.ds-template.is-active {
  outline: 2px solid #c9a655;
  outline-offset: 1px;
}

.ds-template {
  position: relative;
}
.ds-template .ds-template-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  z-index: 2;
  padding: 2px 6px;
  margin: 0;
  border-radius: 999px;
  background: #c9a655;
  color: #1a1204;
  font-size: 8px;
  line-height: 1.4;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  pointer-events: none;
}

/* Colour-theme chips (two-tone) */
.ds-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ds-theme {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(244, 239, 228, 0.16);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.ds-theme:hover {
  transform: translateY(-2px);
  border-color: #c9a655;
}
.ds-theme.is-active {
  outline: 2px solid #c9a655;
  outline-offset: 1px;
}
.ds-theme-bg {
  display: block;
  flex: 1 1 auto;
}
.ds-theme-accent {
  display: block;
  height: 10px;
}

.ds-mini.is-primary {
  background: #c9a655;
  color: #1a1204;
  border-color: #c9a655;
  font-weight: 700;
}
.ds-mini.is-primary:hover {
  filter: brightness(1.05);
}

/* Built-in stock photo tray */
.ds-substack-title {
  margin: 4px 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #9c937d;
}
.ds-stock-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}
.ds-stock {
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(244, 239, 228, 0.16);
  border-radius: 6px;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  padding: 0;
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.ds-stock:hover {
  transform: translateY(-2px);
  border-color: #c9a655;
}

/* Image-source chooser modal (opened by the Image tool) */
.ds-imgpicker {
  position: absolute;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(6, 12, 22, 0.62);
  backdrop-filter: blur(2px);
}
.ds-imgpicker[hidden] {
  display: none;
}
.ds-imgpicker-card {
  width: min(560px, 92vw);
  max-height: 82vh;
  overflow: auto;
  background: #0c1a2c;
  border: 1px solid rgba(244, 239, 228, 0.14);
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}
.ds-imgpicker-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.ds-imgpicker-head strong {
  font-size: 17px;
  color: #f4efe4;
}
.ds-imgpicker-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
@media (max-width: 560px) {
  .ds-imgpicker-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* My designs gallery */
.ds-mydesigns-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
@media (max-width: 560px) {
  .ds-mydesigns-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.ds-saved {
  border: 1px solid rgba(244, 239, 228, 0.14);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  flex-direction: column;
}
.ds-saved-thumb {
  height: 96px;
  background-size: cover;
  background-position: center;
  background-color: #fff;
}
.ds-saved-meta {
  padding: 8px 10px 4px;
}
.ds-saved-meta strong {
  display: block;
  font-size: 12px;
  color: #f4efe4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ds-saved-meta span {
  font-size: 11px;
  color: #9c937d;
}
.ds-saved .ds-btn-row {
  padding: 6px 8px 8px;
}

/* Brand kit */
.ds-brand-logo {
  height: 64px;
  border: 1px dashed rgba(244, 239, 228, 0.2);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}
.ds-brand-logo img {
  max-width: 90%;
  max-height: 54px;
  object-fit: contain;
}
.ds-brand-empty {
  font-size: 12px;
  color: #8f8672;
}
.ds-wrap-row {
  flex-wrap: wrap;
}

.ds-preflight-item {
  margin: 0 0 8px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.4;
  background: rgba(255, 255, 255, 0.05);
  color: #e7dfce;
}
.ds-preflight-item.is-error {
  background: rgba(233, 90, 74, 0.16);
  color: #f6cabf;
}
.ds-preflight-item.is-warn {
  background: rgba(233, 178, 74, 0.14);
  color: #f0dcae;
}

/* Kid-friendly step list in the help panel */
.ds-steps {
  margin: 8px 0 0;
  padding-left: 20px;
  color: #d8d2c4;
  font-size: 13px;
  line-height: 1.7;
}

.ds-steps li {
  margin-bottom: 4px;
}

.ds-steps strong,
.ds-empty-hint strong {
  color: #f4ede0;
}

/* Preview mode: clean, final look */
.ds-artboard.is-preview .ds-el {
  cursor: default;
}

.ds-root.ds-is-preview .ds-surface-tab {
  opacity: 0.9;
}

/* ---------- Folded 3D preview (fold-aware cards) ---------- */
.ds-stage {
  position: relative;
}
.ds-foldstage {
  position: absolute;
  inset: 0;
  z-index: 12;
  display: flex;
  flex-direction: column;
  background: radial-gradient(120% 120% at 50% 0%, #1c2740 0%, #0f1626 60%, #0b111d 100%);
}
.ds-root.ds-is-fold .ds-canvas-wrap,
.ds-root.ds-is-fold .ds-surface-tabs,
.ds-root.ds-is-fold .ds-specline {
  visibility: hidden;
}
.ds-foldstage-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  color: #f4ede0;
  font-size: 0.95rem;
  border-bottom: 1px solid rgba(201, 166, 85, 0.16);
}
.ds-fold-scene {
  flex: 1;
  display: grid;
  place-items: center;
  perspective: 1600px;
  overflow: hidden;
}
.ds-fold-book {
  display: flex;
  transform-style: preserve-3d;
  transform: rotateX(6deg) rotateY(-6deg);
  filter: drop-shadow(0 30px 40px rgba(0, 0, 0, 0.5));
}
.ds-fold-face {
  width: 260px;
  height: 360px;
  background-size: cover;
  background-position: center;
  background-color: #fff;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  display: grid;
  place-items: center;
  color: #7a8496;
  font-size: 0.85rem;
}
/* Two hinged pages meeting at the centre spine. */
.ds-fold-cover {
  transform-origin: right center;
  border-radius: 3px 1px 1px 3px;
  box-shadow: inset -6px 0 14px rgba(0, 0, 0, 0.18);
}
.ds-fold-inside {
  transform-origin: left center;
  border-radius: 1px 3px 3px 1px;
  box-shadow: inset 6px 0 14px rgba(0, 0, 0, 0.1);
}
.ds-fold-controls {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 14px 18px;
  border-top: 1px solid rgba(201, 166, 85, 0.16);
}
.ds-fold-controls input[type="range"] {
  flex: 1;
  min-width: 160px;
  accent-color: #c9a655;
}
.ds-fold-hint {
  color: #aeb7c6;
  font-size: 0.82rem;
}

@media (max-width: 960px) {
  .ds-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
  }

  .ds-panel {
    max-height: 168px;
    border-right: 0;
    border-bottom: 1px solid rgba(201, 166, 85, 0.16);
  }

  .ds-panel.ds-right {
    border-left: 0;
    border-top: 1px solid rgba(201, 166, 85, 0.16);
    max-height: 220px;
  }

  /* Let the crowded action bar scroll sideways instead of overflowing. */
  .ds-topbar {
    gap: 10px;
    padding: 8px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .ds-topbar-spacer {
    flex: 0 0 4px;
  }
  .ds-topbtn,
  .ds-icon-btn {
    flex: 0 0 auto;
  }
  .ds-topbtn {
    padding: 0 10px;
    font-size: 12px;
  }
  .ds-brand {
    flex: 0 0 auto;
  }
}

/* Finger-friendly targets on touch / coarse-pointer devices. */
@media (pointer: coarse) {
  .ds-handle {
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border-width: 2px;
  }
  .ds-el.ds-text {
    min-height: 24px;
  }
  .ds-tool,
  .ds-mini,
  .ds-topbtn {
    min-height: 40px;
  }
}

/* Never let the browser hijack drags on the canvas surface. */
.ds-el,
.ds-handle,
.ds-handles {
  touch-action: none;
}
