:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #d9dde2;
  color: #20242a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 312px 1fr;
  overflow: hidden;
}

.sidebar {
  height: 100vh;
  overflow: auto;
  background: #e9edf1;
  border-right: 1px solid #c8cdd3;
  padding: 10px;
  font-size: 13px;
}

.brand h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.15;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
  padding: 2px 2px 8px;
}

.icon-button {
  width: 32px;
  min-width: 32px;
  min-height: 32px;
  padding: 0;
  border-radius: 50%;
  font-weight: 700;
}

.brand p,
.summary {
  color: #65707d;
  font-size: 12px;
  line-height: 1.28;
}

#pixelSummary {
  margin: -2px 0 8px;
}

#pageDetail {
  margin-top: 5px;
}

#licenseSummary {
  margin-top: 6px;
}

.canvas-actions {
  margin-bottom: 9px;
}

.spotlight-note {
  margin: -3px 0 7px 28px;
}

.qr-note {
  margin: -3px 0 7px;
}

.shape-actions {
  grid-template-columns: 1fr;
}

.background-upload {
  display: grid;
  gap: 8px;
}

.background-actions {
  display: flex;
  gap: 7px;
}

.background-upload .button,
.background-actions button {
  flex: 1 1 0;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 34px;
  margin: 0;
  padding: 0 12px;
}

.background-upload input[type="number"] {
  width: 100%;
}

.sidebar section {
  --section-accent: #6d7885;
  --section-bg: #f5f7f9;
  margin-top: 8px;
  padding: 9px 9px 10px 10px;
  border: 1px solid #d2d8df;
  border-left: 4px solid var(--section-accent);
  border-radius: 8px;
  background: var(--section-bg);
}

.section-toggle {
  width: 100%;
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
}

.section-toggle:hover {
  border-color: transparent;
}

.section-toggle-icon {
  width: 16px;
  height: 16px;
  display: grid;
  place-items: center;
  border: 1px solid #b9c0c8;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.65);
  color: #56616e;
  font-size: 12px;
  line-height: 1;
}

.section-body {
  display: block;
}

.sidebar section.collapsed {
  padding-bottom: 8px;
}

.sidebar section.collapsed .section-body {
  display: none;
}

.sidebar section:nth-of-type(1) {
  --section-accent: #0f6f78;
  --section-bg: #edf7f8;
}

.sidebar section:nth-of-type(2) {
  --section-accent: #496f9b;
  --section-bg: #f0f5fb;
}

.sidebar section:nth-of-type(3) {
  --section-accent: #668052;
  --section-bg: #f2f7ef;
}

.sidebar section:nth-of-type(4) {
  --section-accent: #9a596b;
  --section-bg: #fbf1f4;
}

.sidebar section:nth-of-type(5) {
  --section-accent: #8a6a2d;
  --section-bg: #faf6ec;
}

.sidebar section:nth-of-type(6) {
  --section-accent: #7b5a88;
  --section-bg: #f7f1fa;
}

.sidebar section:nth-of-type(7) {
  --section-accent: #a56142;
  --section-bg: #fbf2ec;
}

.sidebar section:nth-of-type(8) {
  --section-accent: #5d728a;
  --section-bg: #f1f5f8;
}

.sidebar section:nth-of-type(9) {
  --section-accent: #0f6f78;
  --section-bg: #edf8f6;
}

.sidebar section:nth-of-type(10) {
  --section-accent: #596574;
  --section-bg: #f3f5f7;
}

.sidebar section:nth-of-type(11) {
  --section-accent: #766c52;
  --section-bg: #f6f4ee;
}

.sidebar section:nth-of-type(12) {
  --section-accent: #405f74;
  --section-bg: #f0f5f8;
}

.sidebar section:nth-of-type(13) {
  --section-accent: #5f6670;
  --section-bg: #f4f5f7;
}

.sidebar section:nth-of-type(14) {
  --section-accent: #677082;
  --section-bg: #f4f5f7;
}

.sidebar .section-project {
  --section-accent: #0f6f78;
  --section-bg: #edf7f8;
}

.sidebar .section-crop {
  --section-accent: #8a5c9b;
  --section-bg: #f7f1fa;
}

.sidebar .section-canvas {
  --section-accent: #496f9b;
  --section-bg: #f0f5fb;
}

.sidebar .section-spread-mode {
  --section-accent: #6a6540;
  --section-bg: #f8f6ed;
}

.sidebar .section-images {
  --section-accent: #668052;
  --section-bg: #f2f7ef;
}

.sidebar .section-build-settings {
  --section-accent: #9a596b;
  --section-bg: #fbf1f4;
}

.sidebar .section-spotlight {
  --section-accent: #8a6a2d;
  --section-bg: #faf6ec;
}

.sidebar .section-body-text {
  --section-accent: #7b5a88;
  --section-bg: #f7f1fa;
}

.sidebar .section-build-actions {
  --section-accent: #a56142;
  --section-bg: #fbf2ec;
}

.sidebar .section-uploads {
  --section-accent: #5d728a;
  --section-bg: #f1f5f8;
}

.sidebar .section-elements {
  --section-accent: #0f6f78;
  --section-bg: #edf8f6;
}

.sidebar .section-text-addons {
  --section-accent: #596574;
  --section-bg: #f3f5f7;
}

.sidebar .section-qr {
  --section-accent: #766c52;
  --section-bg: #f6f4ee;
}

.sidebar .section-pages {
  --section-accent: #405f74;
  --section-bg: #f0f5f8;
}

.sidebar .section-export {
  --section-accent: #5f6670;
  --section-bg: #f4f5f7;
}

.sidebar .section-about {
  --section-accent: #677082;
  --section-bg: #f4f5f7;
}

h2 {
  margin: 0 0 7px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0;
  color: #3f4853;
}

.section-subhead {
  margin: 2px 0 8px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  color: #596574;
}

label {
  display: grid;
  gap: 4px;
  margin-bottom: 6px;
  font-size: 13px;
  color: #3e4650;
}

input,
select,
button,
.button {
  border: 1px solid #b9c0c8;
  border-radius: 6px;
  background: #fff;
  color: #20242a;
  font: inherit;
  font-size: 13px;
  min-height: 30px;
}

input,
select {
  width: 100%;
  padding: 4px 8px;
}

textarea {
  width: 100%;
  min-height: 76px;
  padding: 7px 8px;
  border: 1px solid #b9c0c8;
  border-radius: 6px;
  background: #fff;
  color: #20242a;
  font: inherit;
  resize: vertical;
}

button,
.button {
  padding: 5px 9px;
  cursor: pointer;
  text-align: center;
  user-select: none;
}

button:hover,
.button:hover {
  border-color: #7c8794;
}

.primary-button {
  background: #0f6f78;
  border-color: #0f6f78;
  color: #fff;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.button input {
  display: none;
}

.button-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.button-row > label {
  margin-bottom: 0;
}

.project-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
}

.project-actions button,
.project-actions .button {
  width: 100%;
}

.preset-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
  align-items: end;
  margin-bottom: 6px;
}

.preset-row label {
  margin-bottom: 0;
}

.segmented-control {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin-bottom: 8px;
  padding: 3px;
  border: 1px solid #c6cdd5;
  border-radius: 7px;
  background: #eef1f4;
}

.segmented-control button {
  min-width: 0;
  min-height: 28px;
  border-color: transparent;
  border-radius: 5px;
  background: transparent;
  color: #4a535e;
  font-weight: 700;
}

.segmented-control button.active {
  background: #ffffff;
  border-color: #9eabb8;
  color: #20242a;
  box-shadow: 0 1px 2px rgba(32, 36, 42, 0.12);
}

.split-page-controls {
  padding-top: 2px;
}

.split-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.split-control-pane {
  min-width: 0;
}

.split-control-pane + .split-control-pane {
  padding-left: 8px;
  border-left: 1px solid rgba(80, 91, 104, 0.24);
}

.split-pane-heading {
  display: grid;
  place-items: center;
  min-height: 26px;
  margin-bottom: 6px;
  border: 1px solid #c6cdd5;
  border-radius: 7px;
  background: #eef1f4;
  color: #3f4853;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.split-button-row .button {
  width: 100%;
  padding-inline: 6px;
}

.split-check {
  margin-top: 7px;
  margin-bottom: 5px;
}

.split-summary {
  line-height: 1.25;
}

.split-settings-grid label {
  gap: 3px;
  margin-bottom: 5px;
  font-size: 12px;
}

.split-settings-grid input,
.split-settings-grid select {
  min-height: 28px;
  padding-inline: 6px;
}

.build-primary-row {
  margin-bottom: 6px;
}

.build-primary-row button {
  width: 100%;
}

.build-reshuffle-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 7px;
}

.build-reshuffle-row button {
  min-width: 0;
  padding-inline: 6px;
}

.build-reshuffle-row #reshuffleBtn {
  grid-column: 1 / -1;
}

.action-control-block {
  margin-bottom: 7px;
}

.action-label {
  margin: 0 0 4px;
  color: #3e4650;
  font-size: 12px;
  font-weight: 700;
}

.action-segment {
  margin-bottom: 0;
}

.action-segment.two-up {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-segment.three-up {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-segment button {
  min-height: 26px;
  padding: 3px 5px;
  font-size: 12px;
}

.action-number-grid {
  margin-bottom: 7px;
}

.action-number-grid label {
  margin-bottom: 0;
}

.fit-canvas-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fit-canvas-actions button {
  min-width: 0;
  padding-inline: 6px;
}

#flipCanvasBtn {
  min-width: 56px;
}

.page-order-actions {
  margin-top: 6px;
}

.page-order-actions button {
  flex: 1 1 calc(50% - 4px);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.designer-area {
  margin: 5px 0 7px;
  padding: 8px;
  border: 1px solid #d1d6dc;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.46);
}

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

.check input {
  width: auto;
}

.page-list {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.page-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 5px 7px;
  border: 1px solid #d1d6dc;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}

.page-item.active {
  border-color: #596574;
  background: #eef1f4;
}

.page-item input {
  width: auto;
  min-height: auto;
}

.page-jump {
  min-height: 26px;
  padding: 3px 8px;
}

.workspace {
  min-width: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: 52px 1fr;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 9px 14px;
  background: #eceff2;
  border-bottom: 1px solid #c8cdd3;
}

#status {
  min-width: 0;
  flex: 1;
  color: #48525f;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.zoom-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.topbar-check {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  margin: 0 4px 0 0;
  padding: 4px 8px;
  border: 1px solid #b9c0c8;
  border-radius: 6px;
  background: #fff;
  color: #303843;
  font-size: 13px;
  cursor: pointer;
}

.topbar-check input {
  width: auto;
  margin: 0;
}

.zoom-controls button {
  min-width: 34px;
  min-height: 30px;
  padding: 4px 9px;
}

.zoom-level {
  min-width: 54px;
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 4px 8px;
  border: 1px solid #b9c0c8;
  border-radius: 6px;
  background: #fff;
  color: #303843;
  font-size: 13px;
}

.stage-wrap {
  overflow: auto;
  padding: 32px 32px 104px;
}

.stage {
  flex: 0 0 auto;
  position: relative;
  width: fit-content;
  height: fit-content;
  margin: 0 auto;
}

.stage.cropping canvas {
  cursor: default;
}

canvas {
  position: absolute;
  display: block;
  background: transparent;
  background-image:
    linear-gradient(45deg, #c5cad0 25%, transparent 25%),
    linear-gradient(-45deg, #c5cad0 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #c5cad0 75%),
    linear-gradient(-45deg, transparent 75%, #c5cad0 75%);
  background-size: 20px 20px;
  background-position: 0 0, 0 10px, 10px -10px, -10px 0;
  box-shadow: 0 12px 32px rgba(24, 31, 40, 0.22);
  cursor: default;
}

.crop-actions {
  margin-top: 6px;
}

#cropToolBtn.active {
  background: #0f6f78;
  border-color: #0f6f78;
  color: #ffffff;
}

.crop-overlay {
  position: absolute;
  z-index: 9;
  pointer-events: none;
}

.crop-box {
  position: absolute;
  border: 2px solid #f8fbff;
  box-shadow: 0 0 0 9999px rgba(9, 18, 28, 0.45), 0 0 0 1px rgba(15, 111, 120, 0.8);
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.5) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 1px, transparent 1px);
  background-size: 33.333% 100%, 100% 33.333%;
  cursor: move;
  pointer-events: auto;
  touch-action: none;
  transform-origin: center;
}

.crop-rotate-handle {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: -38px;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background-color: rgba(15, 111, 120, 0.95);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-3-6.7'/%3E%3Cpath d='M21 3v6h-6'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 18px 18px;
  box-shadow: 0 4px 12px rgba(9, 18, 28, 0.35);
  cursor: grab;
  touch-action: none;
  transform: translateX(-50%);
}

.crop-rotate-handle:active {
  cursor: grabbing;
}

.crop-rotate-handle:hover {
  border-color: #ffffff;
  background-color: #0b5f68;
}

.crop-handle {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #0f6f78;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(20, 28, 36, 0.35);
}

.crop-handle.nw {
  left: -8px;
  top: -8px;
  cursor: nwse-resize;
}

.crop-handle.ne {
  right: -8px;
  top: -8px;
  cursor: nesw-resize;
}

.crop-handle.sw {
  left: -8px;
  bottom: -8px;
  cursor: nesw-resize;
}

.crop-handle.se {
  right: -8px;
  bottom: -8px;
  cursor: nwse-resize;
}

.manual-text-layer {
  position: absolute;
  overflow: visible;
  pointer-events: none;
  z-index: 4;
}

.guide-layer {
  position: absolute;
  overflow: hidden;
  pointer-events: none;
  z-index: 6;
}

.guide-line {
  position: absolute;
  pointer-events: none;
  background: #00d7ff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18);
  opacity: 0.95;
}

.guide-line-x {
  top: 0;
  width: 2px;
  transform: translateX(-1px);
}

.guide-line-y {
  left: 0;
  height: 2px;
  transform: translateY(-1px);
}

.guide-line-gutter {
  opacity: 0.55;
}

.manual-text-display {
  position: absolute;
  overflow: visible;
  transform-origin: center center;
  pointer-events: auto;
  cursor: text;
  user-select: none;
}

.manual-text-fill,
.manual-text-stroke,
.manual-text-content {
  position: absolute;
  inset: 0;
}

.manual-text-stroke {
  border-style: solid;
  pointer-events: none;
}

.manual-text-content {
  overflow: hidden;
  white-space: pre-wrap;
  pointer-events: none;
}

.selection {
  position: absolute;
  pointer-events: none;
  outline: 2px solid #15191f;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.95);
  z-index: 5;
}

.transform-handle {
  --handle-bg: rgba(15, 111, 120, 0.96);
  --handle-rotation: 0rad;
  position: absolute;
  width: 30px;
  min-width: 30px;
  min-height: 30px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 6px;
  background-color: var(--handle-bg);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 20px 20px;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.3);
  transform-origin: center center;
  transform: translate(-50%, -50%) rotate(var(--handle-rotation));
  will-change: transform;
  z-index: 7;
}

.move-handle {
  cursor: grab;
  background-size: 22px 22px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.1' stroke-linecap='round'%3E%3Cpath d='M12 4.5v15M4.5 12h15'/%3E%3Cpath fill='white' stroke='none' d='M12 2.5l2.6 3.4H9.4zM12 21.5l-2.6-3.4h5.2zM2.5 12l3.4-2.6v5.2zM21.5 12l-3.4 2.6V9.4z'/%3E%3C/svg%3E");
}

.move-handle:active,
.rotate-handle:active {
  cursor: grabbing;
}

.duplicate-handle {
  background-image: none;
}

.duplicate-handle::before,
.duplicate-handle::after {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border: 2.6px solid #fff;
  border-radius: 4px;
}

.duplicate-handle::before {
  left: 9.4px;
  top: 6px;
}

.duplicate-handle::after {
  left: 5.9px;
  top: 9.5px;
  background: var(--handle-bg);
}

.rotate-handle {
  cursor: grab;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 12a9 9 0 1 1-3-6.7'/%3E%3Cpath d='M21 3v6h-6'/%3E%3C/svg%3E");
}

.image-rotate-handle {
  --handle-bg: rgba(68, 139, 149, 0.86);
  width: 26px;
  min-width: 26px;
  min-height: 26px;
  border-width: 1.5px;
  background-size: 17px 17px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.22);
}

.delete-handle {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 6h18'/%3E%3Cpath d='M8 6V4h8v2'/%3E%3Cpath d='M6 6l1 15h10l1-15'/%3E%3Cpath d='M10 11v6M14 11v6'/%3E%3C/svg%3E");
}

.resize-handle {
  width: 26px;
  min-width: 26px;
  min-height: 26px;
  cursor: nwse-resize;
}

.resize-handle::before {
  content: "";
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 11px;
  height: 11px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
}

.collage-reshuffle-btn {
  position: absolute;
  min-height: 30px;
  padding: 5px 12px;
  border: 2px solid #fff;
  border-radius: 7px;
  background: rgba(15, 111, 120, 0.96);
  color: #fff;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 5px 14px rgba(0, 0, 0, 0.3);
  transform: translate(-50%, 0);
  z-index: 7;
}

.collage-reshuffle-btn:hover {
  border-color: #fff;
  background: rgba(12, 93, 101, 0.98);
}

.frame-control {
  position: absolute;
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px;
  background: rgba(28, 32, 38, 0.92);
  border-radius: 7px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  z-index: 3;
}

.frame-control input {
  min-height: 24px;
  padding: 0;
}

.frame-control button {
  min-height: 28px;
  padding: 4px 8px;
}

.text-edit-frame {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  transform-origin: center center;
  background: transparent;
  border: 0 solid transparent;
  box-shadow: none;
}

.text-editor {
  position: absolute;
  z-index: 5;
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  outline: 0;
  resize: none;
  overflow: hidden;
  clip-path: inset(0);
  line-height: 1.25;
}

.text-control {
  position: fixed;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
  width: max-content;
  max-width: min(520px, calc(100vw - 16px));
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(28, 32, 38, 0.94);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
  color: #fff;
}

.shape-control,
.image-control {
  position: fixed;
  z-index: 6;
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
  align-items: center;
  width: max-content;
  max-width: min(520px, calc(100vw - 16px));
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(28, 32, 38, 0.94);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
  color: #fff;
}

.taskbar-drag {
  position: relative;
  width: 24px;
  min-width: 24px;
  min-height: 24px;
  padding: 0;
  border-color: #697481;
  background: #343b45;
  cursor: grab;
}

.taskbar-drag::before,
.effect-panel-drag::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #dce3e9;
  transform: translate(-8px, -8px);
  box-shadow:
    6.5px 0 #dce3e9,
    13px 0 #dce3e9,
    0 6.5px #dce3e9,
    6.5px 6.5px #dce3e9,
    13px 6.5px #dce3e9,
    0 13px #dce3e9,
    6.5px 13px #dce3e9,
    13px 13px #dce3e9;
}

.taskbar-drag:active {
  cursor: grabbing;
}

.taskbar-chip {
  display: grid;
  place-items: center;
  min-height: 24px;
  padding: 2px 7px;
  border: 1px solid #697481;
  border-radius: 6px;
  background: #343b45;
  color: #f4f7fa;
  font-size: 11px;
  font-weight: 700;
}

.text-control select,
.text-control input,
.shape-control input,
.image-control input {
  min-width: 0;
  min-height: 22px;
  padding: 1px 5px;
  font-size: 11px;
}

.text-control select {
  width: auto;
  max-width: 124px;
}

.text-control input:not([type="color"]) {
  width: 42px;
}

.shape-control input:not([type="color"]),
.image-control input:not([type="color"]):not([type="range"]) {
  width: 42px;
}

.image-control input[type="range"] {
  width: 132px;
  padding: 0;
}

.text-control #selectedTextFont {
  flex: 0 1 124px;
  width: 124px;
}

.text-control #selectedTextAlign,
.text-control #selectedTextVerticalAlign {
  width: 76px;
}

.text-control input[type="color"],
.shape-control input[type="color"] {
  width: 26px;
  padding: 1px;
}

.text-control button,
.shape-control button,
.image-control button {
  min-height: 22px;
  padding: 1px 6px;
  font-size: 11px;
  white-space: nowrap;
}

.text-control .fx-button,
.shape-control .fx-button,
.image-control .fx-button {
  min-width: 28px;
  padding: 2px 0;
  font-size: 14px;
  font-style: italic;
}

.image-control #imagePhotoEditBtn.active {
  border-color: #88c8ff;
  background: #24445f;
}

.text-control .mini-check,
.shape-control .mini-check {
  flex: 0 0 auto;
  width: max-content;
  min-width: 0;
  min-height: 22px;
  padding: 1px 6px;
  font-size: 11px;
  gap: 4px;
  margin: 0;
}

.text-fill-check {
  order: 20;
}

#selectedTextFillColor {
  order: 21;
}

#selectedTextFillOpacity {
  order: 22;
}

.text-stroke-check {
  order: 23;
}

#selectedTextStrokeColor {
  order: 24;
}

#selectedTextStrokeWidth {
  order: 25;
}

#copyTextStyleBtn {
  order: 26;
}

#pasteTextStyleBtn {
  order: 27;
}

#textEffectsBtn {
  order: 28;
}

.taskbar-break {
  flex: 0 0 100%;
  order: 19;
  height: 0;
}

.text-effects-panel {
  position: fixed;
  right: 16px;
  bottom: 58px;
  z-index: 8;
  width: min(220px, calc(100vw - 24px));
  max-height: min(360px, calc(100vh - 24px));
  overflow: auto;
  padding: 6px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(28, 32, 38, 0.95);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.32);
  color: #fff;
}

.effects-panel-heading {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 4px;
}

.effects-panel-heading strong {
  flex: 1;
  font-size: 12px;
}

.effects-panel-heading .icon-button {
  width: 22px;
  min-width: 22px;
  min-height: 22px;
  border-color: #6d7784;
  background: #fff;
  color: #20242a;
  font-size: 12px;
}

.effect-panel-drag {
  position: relative;
  width: 22px;
  min-width: 22px;
  min-height: 22px;
  padding: 0;
  border-color: #697481;
  background: #343b45;
  cursor: grab;
}

.effect-panel-drag:active {
  cursor: grabbing;
}

.effects-section {
  display: grid;
  gap: 3px;
  padding: 4px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.text-effects-panel .mini-check {
  width: max-content;
  min-height: 22px;
  padding: 1px 6px;
  font-size: 11px;
  gap: 4px;
}

.effects-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px;
}

.effects-grid-compact {
  grid-template-columns: minmax(0, 1fr);
}

.effects-grid label {
  margin-bottom: 0;
  color: #dfe5eb;
  font-size: 10.5px;
}

.effects-grid input,
.effects-grid select {
  min-height: 22px;
  padding: 1px 4px;
  font-size: 11px;
}

.effects-grid input[type="color"] {
  padding: 1px;
}

.mini-check {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 26px;
  margin: 0;
  padding: 2px 5px;
  border: 1px solid #b9c0c8;
  border-radius: 6px;
  background: #fff;
  color: #20242a;
  font-size: 12px;
  white-space: nowrap;
}

.mini-check input {
  width: auto;
  min-height: auto;
  margin: 0;
  padding: 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(25, 30, 36, 0.42);
}

.modal {
  width: min(440px, 100%);
  padding: 22px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #c6ccd3;
  box-shadow: 0 18px 50px rgba(15, 20, 28, 0.28);
}

.modal h2 {
  margin-bottom: 8px;
  font-size: 18px;
  text-transform: none;
  color: #20242a;
}

.modal p,
.modal li {
  margin: 0;
  color: #48525f;
  line-height: 1.45;
}

.modal-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.modal-heading h2 {
  margin: 0;
}

.help-modal {
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
}

.license-modal {
  width: min(520px, 100%);
}

.hero-modal {
  width: min(760px, 100%);
  max-height: min(780px, calc(100vh - 48px));
  overflow: auto;
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
  max-height: 560px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #d1d6dc;
  border-radius: 7px;
  background: #f8f9fa;
}

.hero-choice {
  display: grid;
  gap: 7px;
  padding: 7px;
  min-height: auto;
  text-align: left;
  background: #fff;
}

.hero-choice.selected {
  border-color: #0f6f78;
  box-shadow: 0 0 0 2px rgba(15, 111, 120, 0.2);
}

.hero-choice img {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  background: #dfe3e8;
}

.hero-choice span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  color: #3e4650;
}

.element-choice img {
  object-fit: contain;
  padding: 16px;
}

.element-choice .element-category {
  color: #6d7682;
}

.background-choice img {
  aspect-ratio: 4 / 3;
}

.background-choice .background-category {
  color: #6d7682;
}

.license-actions {
  margin: 18px 0 10px;
}

.license-details {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #d1d6dc;
  border-radius: 7px;
  background: #f8f9fa;
  color: #48525f;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-line;
}

.help-modal h3 {
  margin: 18px 0 7px;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0;
  color: #4d5661;
}

.help-modal ol,
.help-modal ul {
  margin: 0;
  padding-left: 22px;
}

.help-modal li + li {
  margin-top: 5px;
}

.export-modal {
  width: min(620px, 100%);
  max-height: min(780px, calc(100vh - 48px));
  overflow: auto;
}

.export-page-picker {
  display: grid;
  gap: 7px;
  max-height: 220px;
  overflow: auto;
  margin-top: 12px;
  padding: 8px;
  border: 1px solid #d1d6dc;
  border-radius: 7px;
  background: #f8f9fa;
}

.export-page-row {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}

.export-page-row input {
  width: auto;
  min-height: auto;
}

#exportSummary {
  margin-top: 10px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}

.modal .danger {
  background: #7f1d1d;
  border-color: #7f1d1d;
  color: #fff;
}

.modal .primary {
  background: #0f6f78;
  border-color: #0f6f78;
  color: #fff;
}

.busy-box {
  min-width: 220px;
  display: grid;
  gap: 12px;
  justify-items: center;
  padding: 24px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid #c6ccd3;
  box-shadow: 0 18px 50px rgba(15, 20, 28, 0.28);
  color: #20242a;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #cfd6dd;
  border-top-color: #0f6f78;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.hidden {
  display: none;
}

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

  .sidebar {
    height: auto;
    max-height: 48vh;
    border-right: 0;
    border-bottom: 1px solid #c8cdd3;
  }

  .workspace {
    height: 52vh;
  }

  .text-control {
    max-width: min(520px, calc(100vw - 16px));
  }

  .text-effects-panel {
    left: 12px;
    right: 12px;
    bottom: 54px;
    width: auto;
  }

  .effects-grid {
    grid-template-columns: repeat(2, minmax(90px, 1fr));
  }
}
