:root {
  color-scheme: light;
  --page: #edf0f3;
  --panel: #ffffff;
  --ink: #12161d;
  --muted: #626a75;
  --line: #dfe4ea;
  --accent: #1590c8;
  --danger: #d71920;
  --shadow: 0 14px 34px rgba(18, 22, 29, 0.14);
  --header-h: 66px;
  --dock-h: 96px;
  font-family: Arial, Helvetica, sans-serif;
}

.start-overlay {
  position: absolute;
  inset: 0;
  z-index: 18;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(233, 236, 239, 0.82);
}

.start-overlay.active {
  display: flex;
}

.start-card {
  width: min(760px, calc(100vw - 36px));
  max-height: min(78vh, 650px);
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 2px solid #111111;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 20px 52px rgba(18, 22, 29, 0.22);
  overflow: auto;
}

.start-template-button,
.start-actions button {
  min-width: 0;
  min-height: 118px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  padding: 12px;
  border: 2px solid #111111;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: 2px solid #ffffff;
  outline-offset: 0;
}

.start-template-button {
  min-height: 176px;
}

.start-template-button:active,
.start-template-button:hover,
.start-actions button:active,
.start-actions button:hover {
  border-color: var(--accent);
  background: #f1f7fa;
}

.start-template-preview {
  width: min(320px, 74vw);
  display: block;
}

.start-template-preview img,
.start-template-preview .standard-danger-preview,
.start-template-preview .app-template-preview,
.start-template-preview .blank-template-preview {
  width: 100%;
  max-height: 118px;
  object-fit: contain;
}

.start-template-preview .app-template-preview {
  height: auto;
  aspect-ratio: 1.42;
  display: block;
  padding: 8% 5%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.start-template-preview .app-template-header {
  position: relative;
  width: 100%;
  height: 34%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #111111;
  color: #ffffff;
  font-family: "SignAppHeavy", "Arial Black", Arial, sans-serif;
  font-size: 15px;
  font-style: normal;
  line-height: 1;
}

.start-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.start-card strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.15;
  text-align: center;
}

.start-canvas-preview {
  width: 76px;
  height: 76px;
}

.start-canvas-preview rect {
  fill: #ffffff;
  stroke: #111111;
  stroke-width: 3;
  filter: drop-shadow(0 4px 5px rgba(18, 22, 29, 0.14));
}

.bottom-sheet.centered-panel {
  left: 50%;
  right: auto;
  top: 50%;
  bottom: auto;
  width: min(980px, calc(100vw - 30px));
  max-width: calc(100vw - 30px);
  height: min(78vh, 720px);
  max-height: min(78vh, 720px);
  border-radius: 16px;
  padding-bottom: 16px;
  margin-left: calc(-1 * min(490px, calc((100vw - 30px) / 2)));
  margin-top: calc(-1 * min(39vh, 360px));
  transform: none;
  opacity: 0;
  box-shadow: 0 24px 70px rgba(18, 22, 29, 0.28);
}

.bottom-sheet.centered-panel.open {
  transform: none;
  opacity: 1;
}

.bottom-sheet.centered-panel .sheet-content {
  overflow: auto;
}

.bottom-sheet.centered-panel[data-panel="templates"] .grid-options {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(150px * var(--panel-preview-zoom, 1))), 1fr));
}

@media (max-width: 720px) {
  .start-card {
    width: min(420px, calc(100vw - 24px));
    padding: 12px;
  }

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

  .start-template-button {
    min-height: 150px;
  }

  .bottom-sheet.centered-panel {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    height: min(82vh, 700px);
    max-height: min(82vh, 700px);
  }
}

@font-face {
  font-family: "SignAppHeavy";
  src: url("public/fonts/ArchivoBlack-Regular.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: "SignAppHeavy";
  src: url("public/fonts/ArchivoBlack-Regular.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: block;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--page);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.editor-shell {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  background: var(--page);
}

.top-toolbar {
  position: relative;
  z-index: 42;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
  padding: calc(env(safe-area-inset-top, 0px) + 7px) 8px 7px;
  border-bottom: 2px solid #111111;
  background:
    repeating-linear-gradient(135deg, #ffd100 0 32px, #111111 32px 64px);
  color: #111111;
  box-shadow: 0 6px 22px rgba(18, 22, 29, 0.22);
}

.top-toolbar::after {
  content: none;
}

.project-title {
  position: absolute;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + var(--header-h) / 2);
  width: 132px;
  transform: translate(-50%, -50%);
  min-width: 0;
  display: grid;
  gap: 1px;
  align-content: center;
  justify-items: center;
  color: #111111;
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-weight: 900;
  font-size: 14px;
  text-align: center;
  pointer-events: none;
  padding: 2px 12px;
  border: 2px solid #111111;
  border-radius: 8px;
  background: #ffd100;
  box-shadow:
    0 0 0 2px #ffd100,
    0 2px 0 rgba(17, 17, 17, 0.2);
}

.project-title span,
.project-title small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-title small {
  color: rgba(17, 17, 17, 0.72);
  font-size: 10px;
  font-weight: 700;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.left-actions {
  margin-right: auto;
}

.right-actions {
  margin-left: auto;
}

#fullscreenBtn {
  order: 99;
}

.editor-shell:fullscreen,
.editor-shell:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
}

.header-icon {
  width: 33px;
  height: 33px;
  display: grid;
  place-items: center;
  justify-content: center;
  align-content: center;
  border: 2px solid #111111;
  border-radius: 8px;
  background: #ffffff;
  color: #111111;
  outline: 2px solid #ffffff;
  outline-offset: 0;
  -webkit-tap-highlight-color: transparent;
}

.header-icon:active,
.header-icon:hover {
  background: #111111;
  color: #ffffff;
  outline-color: #111111;
}

.header-icon svg,
.dock-button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.canvas-wrap {
  position: relative;
  min-height: 0;
  overflow: hidden;
  touch-action: none;
  background: #e9ecef;
}

.canvas-stage {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: 0 0;
}

.canvas-watermark {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: var(--watermark-bottom, 1.3%);
  transform: translateX(-50%);
  color: #000000;
  font-size: var(--watermark-font-size, 1.2%);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

canvas {
  display: block;
  background: #ffffff;
  border: 1px solid rgba(18, 22, 29, 0.08);
  border-radius: 5px;
  box-shadow: 0 18px 42px rgba(18, 22, 29, 0.16);
  touch-action: none;
}

canvas.border-clipped-canvas {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

canvas.transparent-canvas {
  background:
    linear-gradient(45deg, #d9dde2 25%, transparent 25%, transparent 75%, #d9dde2 75%),
    linear-gradient(45deg, #d9dde2 25%, #ffffff 25%, #ffffff 75%, #d9dde2 75%);
  background-position: 0 0, 8px 8px;
  background-size: 16px 16px;
}

.guide-grid {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: none;
  pointer-events: none;
}

.guide-grid.active {
  display: block;
}

.grid-guide {
  position: absolute;
  pointer-events: none;
}

.grid-guide.vertical {
  top: 0;
  bottom: 0;
  border-left: 1px dotted #8f99a3;
}

.grid-guide.horizontal {
  left: 0;
  right: 0;
  border-top: 1px dotted #8f99a3;
}

.guide {
  position: absolute;
  z-index: 4;
  display: none;
  background: rgba(20, 108, 148, 0.85);
  pointer-events: none;
}

.guide.active {
  display: block;
}

.guide-x {
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
}

.guide-y {
  left: 0;
  top: 50%;
  width: 100%;
  height: 1px;
}

.selection-box {
  position: absolute;
  z-index: 8;
  display: none;
  border: 2px solid var(--accent);
  background: rgba(20, 108, 148, 0.06);
  transform-origin: center center;
  pointer-events: auto;
  touch-action: none;
}

.selection-box.active {
  display: block;
}

.selection-warp-outline {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: none;
  overflow: visible;
  pointer-events: none;
}

.selection-warp-outline polygon {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.selection-box.text-warp-selection {
  border-color: transparent;
  background: transparent;
}

.selection-box.text-warp-selection .selection-warp-outline {
  display: block;
}

.selection-box.text-warp-selection.warp-mode .selection-warp-outline polygon {
  fill: none;
  stroke: #d71920;
}

.selection-box.multi {
  background: rgba(20, 108, 148, 0.03);
  pointer-events: none;
}

.selection-box.multi .handle,
.selection-box.multi .rotate-handle,
.selection-box.multi .object-delete-button,
.selection-box.multi .resize-lock-button {
  pointer-events: auto;
}

.selection-box.multi .handle.n,
.selection-box.multi .handle.e,
.selection-box.multi .handle.s,
.selection-box.multi .handle.w {
  display: none;
}

.selection-box.aspect-locked .handle.n,
.selection-box.aspect-locked .handle.e,
.selection-box.aspect-locked .handle.s,
.selection-box.aspect-locked .handle.w {
  display: none;
}

.multi-selection-layer,
.marquee-box {
  position: absolute;
  inset: 0;
  z-index: 7;
  pointer-events: none;
}

.multi-object-outline {
  position: absolute;
  border: 2px solid #14a3d1;
  background: rgba(20, 163, 209, 0.035);
  transform-origin: center center;
}

.marquee-box {
  display: none;
  inset: auto;
  border: 2px dashed var(--accent);
  background: rgba(20, 108, 148, 0.1);
}

.marquee-box.active {
  display: block;
}

.rotation-angle-label {
  position: absolute;
  z-index: 20;
  display: none;
  min-width: 42px;
  padding: 5px 8px;
  border-radius: 7px;
  background: #17212b;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
  text-align: center;
  pointer-events: none;
  transform: translateY(-100%);
  box-shadow: 0 5px 14px rgba(18, 22, 29, 0.2);
}

.rotation-angle-label.active {
  display: block;
}

.rotation-angle-label.snapped {
  background: var(--accent);
}

.selection-menu {
  position: fixed;
  z-index: 90;
  display: none;
  min-width: 150px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(18, 22, 29, 0.24);
}

.selection-menu.active {
  display: block;
}

.selection-menu button {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 2px solid #111111;
  border-radius: 8px;
  background: #ffffff;
  color: #17212b;
  font-weight: 800;
  text-align: left;
  outline: 2px solid #ffffff;
  outline-offset: 0;
}

.selection-menu button:active {
  background: #eef3f6;
  outline-color: #eef3f6;
}

.inline-text-editor {
  position: absolute;
  z-index: 80;
  display: none;
  min-width: 80px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  outline: none;
  border-radius: 0;
  background: transparent;
  caret-color: #005dff;
  line-height: 1.08;
  white-space: pre;
  overflow-wrap: normal;
  resize: none;
  overflow: hidden;
  transform-origin: center center;
  touch-action: manipulation;
  box-shadow: none;
  appearance: none;
  -webkit-appearance: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-touch-callout: default;
  -webkit-user-select: text;
  user-select: text;
}

.inline-text-editor.active {
  display: block;
}

.text-edit-box {
  position: absolute;
  z-index: 79;
  display: none;
  border: 2px solid #006dff;
  background: rgba(0, 109, 255, 0.04);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9), 0 0 0 3px rgba(0, 109, 255, 0.18);
  pointer-events: none;
  transform-origin: center center;
}

.text-edit-box.active {
  display: block;
}

.text-edit-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid #006dff;
  border-radius: 2px;
  background: #ffffff;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.9);
}

.text-edit-handle.nw { left: -6px; top: -6px; }
.text-edit-handle.n { left: 50%; top: -6px; transform: translateX(-50%); }
.text-edit-handle.ne { right: -6px; top: -6px; }
.text-edit-handle.e { right: -6px; top: 50%; transform: translateY(-50%); }
.text-edit-handle.se { right: -6px; bottom: -6px; }
.text-edit-handle.s { left: 50%; bottom: -6px; transform: translateX(-50%); }
.text-edit-handle.sw { left: -6px; bottom: -6px; }
.text-edit-handle.w { left: -6px; top: 50%; transform: translateY(-50%); }

.text-edit-caret {
  position: absolute;
  z-index: 82;
  display: none;
  width: 3px;
  min-height: 22px;
  border-radius: 2px;
  background: #005dff;
  box-shadow: 0 0 0 1px #ffffff, 0 0 0 3px rgba(0, 93, 255, 0.16);
  pointer-events: none;
  transform-origin: center center;
  animation: text-caret-blink 1s steps(2, start) infinite;
}

.text-edit-caret.active {
  display: block;
}

@keyframes text-caret-blink {
  0%, 45% { opacity: 1; }
  46%, 100% { opacity: 0; }
}

.inline-text-actions {
  position: absolute;
  z-index: 83;
  display: none;
  gap: 8px;
  align-items: center;
  transform-origin: left center;
  pointer-events: auto;
  touch-action: manipulation;
}

.inline-text-actions.active {
  display: flex;
}

.inline-text-actions button {
  width: 38px;
  height: 34px;
  border: 3px solid #ffffff;
  border-radius: 999px;
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 3px 10px rgba(18, 22, 29, 0.3);
}

.inline-text-cancel {
  background: #d71920;
}

.inline-text-confirm {
  background: #168447;
}

.handle,
.rotate-handle,
.object-delete-button,
.resize-lock-button,
.warp-handle,
.warp-decision {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 3px 10px rgba(18, 22, 29, 0.3);
  touch-action: none;
}

.warp-handle,
.warp-decision {
  display: none;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.selection-box.warp-mode {
  border-style: dashed;
  border-color: #d71920;
  background: rgba(215, 25, 32, 0.1);
}

.selection-box.text-warp-selection.warp-mode {
  border-color: transparent;
  background: transparent;
}

.selection-box.warp-mode .handle,
.selection-box.warp-mode .rotate-handle,
.selection-box.warp-mode .object-delete-button,
.selection-box.warp-mode .resize-lock-button {
  display: none;
}

.selection-box.warp-mode .warp-decision {
  display: flex;
}

.selection-box.free-transform-mode .warp-corner,
.selection-box.bow-warp-mode .warp-bow,
.selection-box.bow-warp-mode .warp-horizontal,
.selection-box.bow-warp-mode .warp-vertical {
  display: flex;
}

.warp-corner {
  width: 9px;
  height: 9px;
  padding: 0;
  background: #d71920;
}

.warp-corner::before {
  content: "";
  position: absolute;
  inset: -13px;
}

.warp-nw {
  left: calc(var(--warp-nw-x, 0px) - 5px);
  top: calc(var(--warp-nw-y, 0px) - 5px);
  cursor: nwse-resize;
}

.warp-ne {
  left: calc(100% + var(--warp-ne-x, 0px) - 5px);
  top: calc(var(--warp-ne-y, 0px) - 5px);
  cursor: nesw-resize;
}

.warp-se {
  left: calc(100% + var(--warp-se-x, 0px) - 5px);
  top: calc(100% + var(--warp-se-y, 0px) - 5px);
  cursor: nwse-resize;
}

.warp-sw {
  left: calc(var(--warp-sw-x, 0px) - 5px);
  top: calc(100% + var(--warp-sw-y, 0px) - 5px);
  cursor: nesw-resize;
}

.warp-bow {
  width: 9px;
  height: 9px;
  padding: 0;
  background: #d71920;
}

.warp-bow::before {
  content: "";
  position: absolute;
  inset: -13px;
}

.warp-top-left {
  left: calc(var(--warp-nw-x, 0px) - 5px);
  top: calc(var(--warp-nw-y, 0px) - 5px);
  cursor: nwse-resize;
}

.warp-top-right {
  left: calc(100% + var(--warp-ne-x, 0px) - 5px);
  top: calc(var(--warp-ne-y, 0px) - 5px);
  cursor: nesw-resize;
}

.warp-bottom-left {
  left: calc(var(--warp-sw-x, 0px) - 5px);
  top: calc(100% + var(--warp-sw-y, 0px) - 5px);
  cursor: nesw-resize;
}

.warp-bottom-right {
  left: calc(100% + var(--warp-se-x, 0px) - 5px);
  top: calc(100% + var(--warp-se-y, 0px) - 5px);
  cursor: nwse-resize;
}

.warp-horizontal {
  left: calc(var(--warp-h-x, 50%) - 5px);
  top: calc(var(--warp-h-y, 100%) - 5px);
  width: 9px;
  height: 9px;
  padding: 0;
  background: #d71920;
  color: transparent;
  font-size: 0;
  cursor: ew-resize;
}

.warp-vertical {
  left: calc(var(--warp-v-x, 100%) - 5px);
  top: calc(var(--warp-v-y, 50%) - 5px);
  width: 9px;
  height: 9px;
  padding: 0;
  background: #d71920;
  color: transparent;
  font-size: 0;
  cursor: ns-resize;
}

.warp-horizontal::before,
.warp-vertical::before {
  content: "";
  position: absolute;
  inset: -13px;
}

.warp-decision {
  top: -54px;
  width: 38px;
  height: 34px;
}

.warp-cancel {
  left: -2px;
  background: #d71920;
}

.warp-confirm {
  right: -2px;
  background: #168447;
}

.object-delete-button {
  right: -2px;
  top: -30px;
  width: 24px;
  height: 16px;
  border-radius: 999px;
  background: #d71920;
  color: #ffffff;
  font-size: 7px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
}

.resize-lock-button {
  left: -2px;
  top: -30px;
  width: 28px;
  height: 16px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 5.8px;
  font-weight: 900;
  line-height: 1;
  padding: 0;
  letter-spacing: 0;
}

.selection-box.resize-from-center .resize-lock-button {
  background: #168447;
}

.handle {
  width: 9px;
  height: 9px;
  border-width: 2px;
  box-shadow: 0 2px 5px rgba(18, 22, 29, 0.3);
}

.handle::before {
  content: "";
  position: absolute;
  inset: -9px;
}

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

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

.handle.n {
  left: 50%;
  top: -5px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.handle.e {
  right: -5px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

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

.handle.s {
  left: 50%;
  bottom: -5px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

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

.handle.w {
  left: -5px;
  top: 50%;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.selection-box.text-warp-selection .handle.nw {
  left: calc(var(--warp-nw-x, 0px) - 5px);
  top: calc(var(--warp-nw-y, 0px) - 5px);
}

.selection-box.text-warp-selection .handle.ne {
  left: calc(100% + var(--warp-ne-x, 0px) - 5px);
  right: auto;
  top: calc(var(--warp-ne-y, 0px) - 5px);
}

.selection-box.text-warp-selection .handle.n {
  left: calc(var(--warp-n-x, 50%) - 5px);
  top: calc(var(--warp-n-y, 0px) - 5px);
  transform: none;
}

.selection-box.text-warp-selection .handle.e {
  left: calc(var(--warp-e-x, 100%) - 5px);
  right: auto;
  top: calc(var(--warp-e-y, 50%) - 5px);
  transform: none;
}

.selection-box.text-warp-selection .handle.sw {
  left: calc(var(--warp-sw-x, 0px) - 5px);
  top: calc(100% + var(--warp-sw-y, 0px) - 5px);
  bottom: auto;
}

.selection-box.text-warp-selection .handle.s {
  left: calc(var(--warp-s-x, 50%) - 5px);
  top: calc(var(--warp-s-y, 100%) - 5px);
  bottom: auto;
  transform: none;
}

.selection-box.text-warp-selection .handle.se {
  left: calc(100% + var(--warp-se-x, 0px) - 5px);
  right: auto;
  top: calc(100% + var(--warp-se-y, 0px) - 5px);
  bottom: auto;
}

.selection-box.text-warp-selection .handle.w {
  left: calc(var(--warp-w-x, 0px) - 5px);
  top: calc(var(--warp-w-y, 50%) - 5px);
  transform: none;
}

.rotate-handle {
  left: 50%;
  top: -31px;
  display: grid;
  place-items: center;
  transform: translateX(-50%);
  color: #ffffff;
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  cursor: grab;
  padding: 0;
}

.rotate-handle::after {
  content: none;
}

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

.selection-box.compact-selection .resize-lock-button {
  left: 50%;
  top: -30px;
  transform: translateX(calc(-100% - 16px));
}

.selection-box.compact-selection .object-delete-button {
  right: 50%;
  top: -30px;
  transform: translateX(calc(100% + 16px));
}

.selection-box.tiny-selection .resize-lock-button {
  left: 50%;
  top: -30px;
  transform: translateX(calc(-100% - 16px));
}

.selection-box.tiny-selection .object-delete-button {
  left: auto;
  right: 50%;
  top: -30px;
  transform: translateX(calc(100% + 16px));
}

.selection-box.tiny-selection .rotate-handle {
  top: -31px;
}

.bottom-dock {
  position: relative;
  z-index: 40;
  height: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px));
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 74px;
  gap: 2px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 7px 8px max(12px, env(safe-area-inset-bottom, 0px));
  background: #ffffff;
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 22px rgba(18, 22, 29, 0.08);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.bottom-dock::-webkit-scrollbar {
  display: none;
}

.dock-button {
  min-height: 70px;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 5px;
  border-radius: 12px;
  background: #ffffff;
  color: #363d46;
  outline: 2px solid #ffffff;
  outline-offset: 0;
  -webkit-tap-highlight-color: transparent;
}

.dock-button:active,
.dock-button:hover {
  background: #eef3f6;
  outline-color: #eef3f6;
}

.dock-button span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  color: #323941;
}

.dock-button small {
  max-width: 70px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.floating-toolbar {
  position: fixed;
  left: 8px;
  right: 8px;
  bottom: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px) + 8px);
  z-index: 18;
  display: none;
  min-height: 56px;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 8px 22px rgba(18, 22, 29, 0.12);
}

.floating-toolbar .done-action {
  position: sticky;
  right: 0;
  z-index: 2;
  background: var(--accent);
  color: #ffffff;
  outline: 2px solid var(--accent);
  outline-offset: 0;
}

.floating-toolbar.active {
  display: flex;
}

.floating-toolbar button {
  min-height: 42px;
  flex: 0 0 auto;
  padding: 0 12px;
  border: 2px solid #111111;
  border-radius: 8px;
  background: #eef1f4;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  outline: 2px solid #eef1f4;
  outline-offset: 0;
}

.rotation-input-label {
  min-height: 42px;
  flex: 0 0 72px;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef1f4;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.rotation-input-label input {
  width: 44px;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: center;
}

.sheet-scrim {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  background: rgba(18, 22, 29, 0.18);
}

.sheet-scrim.open {
  display: block;
}

.bottom-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--dock-h) + env(safe-area-inset-bottom, 0px));
  z-index: 32;
  width: 100%;
  max-width: 100vw;
  max-height: min(68vh, 620px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  padding: 8px 14px 16px;
  border-radius: 26px 26px 0 0;
  background: var(--panel);
  box-shadow: 0 -22px 58px rgba(18, 22, 29, 0.22);
  overflow: hidden;
  transform: translateY(105%);
  transition: transform 220ms ease, opacity 140ms ease;
}

.bottom-sheet[data-panel="colours"] {
  height: min(34.5vh, 323px);
}

.bottom-sheet[data-panel="text"] {
  height: min(34.5vh, 323px);
}

.bottom-sheet[data-panel="uploads"] {
  height: min(46vh, 430px);
}

.bottom-sheet.open {
  transform: translateY(0);
}

.bottom-sheet.previewing-control {
  background: rgba(255, 255, 255, 0.02);
  box-shadow: none;
}

.bottom-sheet.previewing-control .sheet-handle,
.bottom-sheet.previewing-control .sheet-head,
.bottom-sheet.previewing-control .sheet-content > * {
  opacity: 0.02;
}

.bottom-sheet.previewing-control .preview-active-control {
  position: relative;
  z-index: 2;
  opacity: 1;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 24px rgba(18, 22, 29, 0.18);
}

.bottom-sheet.previewing-control .preview-active-control * {
  opacity: 1;
}

.sheet-handle {
  width: 46px;
  height: 5px;
  justify-self: center;
  margin: 2px 0 8px;
  border-radius: 999px;
  background: #c7ced6;
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 8px;
}

.sheet-head h2 {
  flex: 0 0 auto;
  margin: 0;
  font-size: 18px;
  line-height: 1.1;
}

.preview-zoom-control {
  flex: 1 1 150px;
  max-width: 220px;
  display: grid;
  grid-template-columns: auto minmax(72px, 1fr);
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.preview-zoom-control input {
  width: 100%;
  min-width: 0;
  accent-color: var(--accent);
}

.sheet-head button {
  position: relative;
  z-index: 2;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #eef1f4;
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.sheet-content {
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0 0 8px;
}

.sheet-content > * {
  min-width: 0;
  max-width: 100%;
}

.sheet-content h3 {
  margin: 10px 0 5px;
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
}

.stack {
  display: grid;
  gap: 8px;
}

.wide-action,
.danger-action {
  width: 100%;
  min-height: 48px;
  margin: 4px 0;
  padding: 0 14px;
  border: 2px solid #111111;
  border-radius: 8px;
  background: #eef1f4;
  color: var(--ink);
  font-weight: 900;
  text-align: left;
  outline: 2px solid #eef1f4;
  outline-offset: 0;
}

.danger-action {
  background: #fff0f0;
  color: var(--danger);
  outline-color: #fff0f0;
}

.hint {
  margin: 5px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.styled-text-value {
  min-height: 46px;
  height: auto;
  padding: 8px 10px;
  overflow-x: hidden;
  overflow-y: auto;
  white-space: pre-wrap;
  overflow-wrap: normal;
}

.help-panel {
  display: grid;
  gap: 10px;
}

.help-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.help-copy {
  min-width: 0;
}

.help-copy h3 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.15;
  text-transform: none;
}

.help-copy p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.help-copy p:last-child {
  margin-bottom: 0;
}

.help-example {
  width: 132px;
  height: 82px;
  display: block;
  border: 1px solid #d8e0e7;
  border-radius: 8px;
  background: #f7f9fb;
}

.help-example .help-fill {
  fill: #ffffff;
  stroke: #111111;
  stroke-width: 4;
}

.help-example .help-dark {
  fill: #111111;
}

.help-example .help-outline,
.help-example .help-pill {
  fill: #ffffff;
  stroke: #1590c8;
  stroke-width: 4;
}

.help-example .help-pill {
  fill: #eaf5fa;
  stroke-width: 2;
}

.help-example .help-pill-green {
  fill: #168447;
  stroke: #ffffff;
  stroke-width: 3;
}

.help-example .help-pill-red {
  fill: #d71920;
  stroke: #ffffff;
  stroke-width: 3;
}

.help-example .help-handle {
  fill: #1590c8;
}

.help-example .help-confirm {
  fill: #00843d;
}

.help-example .help-cancel {
  fill: #d71920;
}

.help-example .help-line {
  fill: none;
  stroke: #1590c8;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.help-example .help-dash {
  fill: none;
  stroke: #1590c8;
  stroke-width: 3;
  stroke-dasharray: 6 6;
  stroke-linecap: round;
}

.help-example .help-grid {
  fill: none;
  stroke: #c5d0d9;
  stroke-width: 2;
  stroke-dasharray: 3 4;
}

.help-example .help-text {
  fill: #12161d;
  font-size: 10px;
  font-weight: 900;
}

.help-example .help-text-large {
  fill: #12161d;
  font-size: 27px;
  font-weight: 900;
}

.help-example .help-knob-text {
  fill: #ffffff;
  font-size: 11px;
  font-weight: 900;
}

.help-example .help-rotate-text {
  fill: #ffffff;
  font-size: 16px;
  font-weight: 900;
  pointer-events: none;
}

.help-example .help-mark {
  fill: none;
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

.bottom-sheet[data-panel="templates"] .grid-options,
.bottom-sheet[data-panel="shapes"] .grid-options {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(140px * var(--panel-preview-zoom, 1))), 1fr));
}

.tile {
  min-height: max(44px, calc(64px * var(--panel-preview-zoom, 1)));
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 6px;
  padding: 8px;
  border: 2px solid #111111;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  outline: 2px solid #ffffff;
  outline-offset: 0;
}

.template-tile span {
  width: 48px;
  height: 28px;
  border: 2px solid #111111;
  border-radius: 3px;
}

.image-template-tile {
  min-height: max(64px, calc(120px * var(--panel-preview-zoom, 1)));
  align-content: start;
}

.template-tile-wrap {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.template-tile-wrap .image-template-tile {
  width: 100%;
}

.template-delete-button {
  min-height: 34px;
  border: 1px solid #d7a3a3;
  border-radius: 9px;
  background: #fff4f4;
  color: #a31515;
  font-size: 11px;
  font-weight: 900;
}

.template-delete-button:active,
.template-delete-button:hover {
  border-color: #a31515;
  background: #ffe5e5;
}

.image-template-tile img {
  width: 100%;
  aspect-ratio: 1.414 / 1;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(18, 22, 29, 0.1);
}

.standard-danger-preview {
  position: relative;
  width: 100%;
  height: auto;
  aspect-ratio: 1.414 / 1;
  display: block;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(18, 22, 29, 0.1);
}

.template-tile .standard-danger-preview {
  width: 100%;
  height: auto;
}

.standard-danger-preview img {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.standard-danger-preview b {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111111;
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-weight: 900;
  letter-spacing: 0;
  text-align: center;
  white-space: pre-line;
  overflow: hidden;
}

.blank-template-preview {
  width: 100%;
  aspect-ratio: 1.414 / 1;
  display: block;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 5px 14px rgba(18, 22, 29, 0.08);
}

.template-tile .blank-template-preview {
  width: 100%;
  height: auto;
  aspect-ratio: 1.414 / 1;
}

.au-template-preview {
  width: 100%;
  aspect-ratio: 1.414 / 1;
  display: grid;
  place-items: center;
  border: 3px solid #111111;
  border-radius: 5px;
  background: #ffffff;
}

.au-template-preview img {
  width: 46%;
  height: 70%;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  filter: brightness(0);
}

.au-template.warning .au-template-preview,
.au-template.caution .au-template-preview {
  background: #ffd100;
}

.au-template.mandatory .au-template-preview {
  border-color: #0057a8;
  background: #0057a8;
}

.au-template.emergency .au-template-preview {
  border-color: #00843d;
  background: #00843d;
}

.au-template.fire .au-template-preview,
.au-template.danger .au-template-preview {
  border-color: #d71920;
  background: #d71920;
}

.au-template.notice .au-template-preview {
  border-color: #0057a8;
}

.au-template.mandatory .au-template-preview img,
.au-template.emergency .au-template-preview img,
.au-template.fire .au-template-preview img,
.au-template.danger .au-template-preview img {
  filter: brightness(0) invert(1);
}

.image-template-tile strong {
  font-size: 12px;
}

.image-template-tile small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.text-preset-tile {
  font-family: "Arial Black", Arial, Helvetica, sans-serif;
  font-size: calc(16px * var(--panel-preview-zoom, 1));
  line-height: 1.05;
}

.text-preset-tile.subheading {
  font-size: calc(14px * var(--panel-preview-zoom, 1));
}

.text-preset-tile.body {
  font-family: Arial, Helvetica, sans-serif;
  font-size: calc(13px * var(--panel-preview-zoom, 1));
}

.shape-swatch {
  width: calc(42px * var(--panel-preview-zoom, 1));
  height: calc(30px * var(--panel-preview-zoom, 1));
  display: block;
  border: 3px solid #111111;
  background: #ffffff;
}

.shape-swatch.roundRect {
  border-radius: 10px;
}

.shape-swatch.signRect {
  border-radius: 10px 10px 0 0;
}

.shape-swatch.circle {
  width: calc(34px * var(--panel-preview-zoom, 1));
  height: calc(34px * var(--panel-preview-zoom, 1));
  border-radius: 50%;
}

.shape-swatch.oval {
  width: calc(46px * var(--panel-preview-zoom, 1));
  border-radius: 50%;
}

.shape-swatch.diamond {
  width: calc(30px * var(--panel-preview-zoom, 1));
  height: calc(30px * var(--panel-preview-zoom, 1));
  transform: rotate(45deg);
  border-radius: 1px;
}

.shape-swatch.roadArrow {
  border-radius: 8px;
}

.shape-preview-svg {
  width: calc(48px * var(--panel-preview-zoom, 1));
  height: calc(42px * var(--panel-preview-zoom, 1));
  overflow: visible;
  fill: #ffffff;
  stroke: #111111;
  stroke-width: 3;
  stroke-linejoin: round;
}

.bubble-preview-svg {
  width: calc(52px * var(--panel-preview-zoom, 1));
  height: calc(44px * var(--panel-preview-zoom, 1));
}

.triangle-preview-svg,
.hexagon-preview-svg {
  width: calc(52px * var(--panel-preview-zoom, 1));
  height: calc(44px * var(--panel-preview-zoom, 1));
}

.sign-preview-svg {
  width: calc(64px * var(--panel-preview-zoom, 1));
  height: calc(52px * var(--panel-preview-zoom, 1));
}

.sign-preview-header {
  fill: #111111;
  stroke: none;
}

.visual-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  min-width: 0;
  max-width: 100%;
}

.bottom-sheet[data-panel="lines"] .visual-tool-grid,
.bottom-sheet[data-panel="arrows"] .visual-tool-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(150px * var(--panel-preview-zoom, 1))), 1fr));
}

.visual-tool-tile {
  min-height: max(44px, calc(76px * var(--panel-preview-zoom, 1)));
  display: grid;
  place-items: center;
  padding: 9px;
  border: 2px solid #111111;
  border-radius: 8px;
  background: #ffffff;
  color: #111111;
  outline: 2px solid #ffffff;
  outline-offset: 0;
}

.visual-tool-tile:active,
.visual-tool-tile:hover {
  border-color: var(--accent);
  background: #f1f7fa;
  outline-color: #f1f7fa;
}

.line-preview-svg {
  width: min(calc(120px * var(--panel-preview-zoom, 1)), 92%);
  height: calc(28px * var(--panel-preview-zoom, 1));
  overflow: visible;
  fill: none;
  stroke: currentColor;
}

.line-preview {
  position: relative;
  display: block;
  width: min(110px, 82%);
  height: 20px;
}

.line-preview::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  border-top: 4px solid #111111;
  transform: translateY(-50%);
}

.line-preview.dashed::after {
  border-top-style: dashed;
}

.line-preview.dotted::after {
  border-top: 0;
  height: 5px;
  background: radial-gradient(circle, #111111 0 2.5px, transparent 3px) 0 50% / 14px 5px repeat-x;
}

.line-preview.thick::after {
  border-top-width: 12px;
}

.line-preview.divider::after {
  border-top-width: 2px;
}

.arrow-preview-tile svg {
  width: min(calc(120px * var(--panel-preview-zoom, 1)), 92%);
  height: calc(54px * var(--panel-preview-zoom, 1));
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.arrow-preview-tile svg.filled-arrow {
  fill: currentColor;
  stroke: none;
}

.arrow-preview-tile .preview-arrow-head {
  fill: currentColor;
  stroke: none;
}

.chip-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  min-height: 40px;
  padding: 0 12px;
  border: 2px solid #111111;
  border-radius: 8px;
  background: #eef1f4;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  outline: 2px solid #eef1f4;
  outline-offset: 0;
}

.element-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
  padding-bottom: 2px;
  overflow-x: hidden;
  max-width: 100%;
  scrollbar-width: thin;
}

.element-tabs button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 13px;
  border: 2px solid #111111;
  border-radius: 8px;
  background: #ffffff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
  outline: 2px solid #ffffff;
  outline-offset: 0;
}

.element-tabs button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #ffffff;
  outline-color: var(--ink);
}

.template-tabs button.template-tab-danger,
.template-tabs button.template-tab-danger.active {
  border-color: #111111;
  background: #d71920;
  color: #ffffff;
  outline-color: #d71920;
}

.template-tabs button.template-tab-caution,
.template-tabs button.template-tab-caution.active {
  border-color: #111111;
  background: #ffd100;
  color: #111111;
  outline-color: #ffd100;
}

.template-tabs button.template-tab-ppe,
.template-tabs button.template-tab-ppe.active {
  border-color: #111111;
  background: #0057a8;
  color: #ffffff;
  outline-color: #0057a8;
}

.template-tabs button.active {
  border-color: #111111;
  background: #111111;
  color: #ffffff;
  outline-color: #111111;
}

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

.bottom-sheet[data-panel="elements"] .safety-icon-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, calc(96px * var(--panel-preview-zoom, 1))), 1fr));
}

.safety-icon-tile {
  min-width: 0;
  min-height: max(44px, calc(94px * var(--panel-preview-zoom, 1)));
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 5px;
  padding: 7px 5px;
  border: 2px solid #111111;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: 2px solid #ffffff;
  outline-offset: 0;
}

.safety-icon-tile span {
  width: calc(54px * var(--panel-preview-zoom, 1));
  height: calc(54px * var(--panel-preview-zoom, 1));
  display: grid;
  place-items: center;
  border-radius: 50%;
}

.safety-icon-tile img {
  width: calc(48px * var(--panel-preview-zoom, 1));
  height: calc(48px * var(--panel-preview-zoom, 1));
  object-fit: contain;
  filter: none;
}

.safety-icon-tile[data-sign-type="warning"] span,
.safety-icon-tile[data-sign-type="prohibition"] span {
  border-radius: 8px;
}

.safety-icon-tile small {
  max-width: 100%;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.15;
  text-align: center;
}

.swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.colour-sections {
  display: grid;
  grid-template-columns: minmax(44px, 0.5fr) minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  margin-top: 4px;
}

.colour-section {
  min-width: 0;
}

.colour-section h3 {
  margin-top: 0;
}

.colour-current-section {
  display: grid;
  justify-items: start;
}

.square-colour-input {
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.square-colour-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.square-colour-input::-webkit-color-swatch {
  border: 0;
  border-radius: 4px;
}

.square-colour-input::-moz-color-swatch {
  border: 0;
  border-radius: 4px;
}

.swatches button {
  width: 20px;
  height: 20px;
  min-height: 20px;
  flex: 0 0 20px;
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

.clear-colour-swatch,
.clear-colour-preview {
  background:
    linear-gradient(45deg, transparent 43%, #d71920 44%, #d71920 56%, transparent 57%),
    linear-gradient(45deg, #d9dde2 25%, transparent 25%, transparent 75%, #d9dde2 75%),
    linear-gradient(45deg, #d9dde2 25%, #ffffff 25%, #ffffff 75%, #d9dde2 75%);
  background-position: center, 0 0, 7px 7px;
  background-size: 100% 100%, 14px 14px, 14px 14px;
}

.control-row,
.field-label {
  display: grid;
  gap: 5px;
  margin: 6px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.control-row {
  grid-template-columns: minmax(92px, 0.7fr) minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.control-row > *,
.field-label > *,
.segmented > *,
.swatches > *,
.grid-options > *,
.visual-tool-grid > * {
  min-width: 0;
}

.control-row output {
  margin-left: 5px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.control-row input,
.control-row select,
.field-label textarea {
  width: 100%;
  max-width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  color: var(--ink);
  padding: 7px 10px;
}

.toggle-row {
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 8px 0;
  padding: 0 2px;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.toggle-row input {
  width: 24px;
  height: 24px;
  accent-color: var(--accent);
}

.field-label textarea {
  resize: vertical;
  font-size: 16px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin: 5px 0;
  padding: 3px;
  border-radius: 11px;
  background: #eef1f4;
}

.segmented.two-options {
  grid-template-columns: repeat(2, 1fr);
}

.segmented.text-style-segmented {
  grid-template-columns: repeat(4, 1fr);
}

.segmented button {
  min-height: 34px;
  border: 2px solid #111111;
  border-radius: 8px;
  background: transparent;
  font-size: 12px;
  font-weight: 900;
  outline: 2px solid #eef1f4;
  outline-offset: 0;
}

.segmented.two-options {
  max-width: 260px;
}

.style-target-options {
  width: 100%;
  max-width: none;
  margin-left: auto;
  margin-right: auto;
}

.bottom-sheet[data-panel="colours"] .sheet-content {
  padding-bottom: 4px;
}

.bottom-sheet[data-panel="colours"] .hint {
  margin: 2px 0 3px;
}

.bottom-sheet[data-panel="colours"] .segmented {
  margin: 3px 0;
}

.bottom-sheet[data-panel="colours"] .colour-sections {
  gap: 5px;
  margin-top: 2px;
}

.bottom-sheet[data-panel="colours"] .colour-section h3 {
  margin-bottom: 3px;
}

.bottom-sheet[data-panel="colours"] .control-row {
  gap: 4px;
  margin: 3px 0;
}

.bottom-sheet[data-panel="colours"] .swatches {
  gap: 4px;
}

.segmented button.active,
.segmented button:active {
  background: #ffffff;
  outline-color: #ffffff;
}

.canvas-size-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.canvas-size-grid button {
  min-height: 92px;
  display: grid;
  place-items: center;
  gap: 7px;
  padding: 10px;
  border: 2px solid #111111;
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
  outline: 2px solid #ffffff;
  outline-offset: 0;
}

.canvas-size-grid button.active {
  border-color: var(--accent);
  outline-color: #ffffff;
}

.canvas-size-grid strong {
  font-size: 12px;
}

.canvas-size-preview {
  display: block;
  width: 48px;
  height: 34px;
  border: 2px solid #303841;
  border-radius: 3px;
  background: #ffffff;
  box-shadow: 0 3px 8px rgba(18, 22, 29, 0.12);
}

.canvas-size-preview.vertical {
  width: 34px;
  height: 48px;
}

.layer-list {
  display: grid;
  gap: 8px;
}

.layer-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, auto);
  gap: 5px;
  align-items: center;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
}

.layer-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(20, 108, 148, 0.12);
}

.layer-item.editing {
  border-color: #006dff;
  background: #eaf3ff;
  box-shadow: inset 4px 0 0 #006dff, 0 0 0 2px rgba(0, 109, 255, 0.16);
}

.layer-item button {
  min-height: 34px;
  padding: 0 8px;
  border-radius: 10px;
  background: #eef1f4;
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
}

.layer-item button:first-child {
  grid-column: 1 / -1;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-browser-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.file-browser {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.file-browser-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
}

.file-browser-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 900;
}

.file-browser-head small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-browser-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) auto auto;
  gap: 6px;
  align-items: center;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
}

.file-browser-row button {
  min-height: 38px;
  border-radius: 7px;
  font-size: 11px;
  font-weight: 900;
}

.file-browser-thumb {
  width: 54px;
  height: 40px;
  overflow: hidden;
  background: #eef1f4;
  color: var(--muted);
}

.file-browser-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.file-browser-thumb span {
  display: grid;
  height: 100%;
  place-items: center;
  font-size: 16px;
}

.file-browser-main {
  min-width: 0;
  padding: 0 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.file-browser-main strong,
.file-browser-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-browser-main strong {
  font-size: 12px;
}

.file-browser-main small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.file-browser-open {
  padding: 0 10px;
  background: var(--accent);
  color: #ffffff;
}

.file-browser-delete {
  padding: 0 8px;
  background: #ffe9e9;
  color: var(--danger);
}

@media (max-width: 520px) {
  .top-toolbar {
    background:
      repeating-linear-gradient(135deg, #ffd100 0 16px, #111111 16px 32px);
  }

  .file-browser-row {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }

  .file-browser-thumb {
    width: 48px;
  }

  .file-browser-delete {
    grid-column: 2 / -1;
    justify-self: end;
    min-height: 32px;
  }
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-h) + 28px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  transform: translateX(-50%);
  padding: 10px 14px;
  border-radius: 999px;
  background: #12161d;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  box-shadow: var(--shadow);
}

.print-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: none;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 12px) 12px calc(env(safe-area-inset-bottom, 0px) + 12px);
  background: #f2f4f6;
}

.print-overlay.active {
  display: grid;
}

.print-preview-actions {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.print-preview-actions button {
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 900;
  box-shadow: 0 5px 16px rgba(18, 22, 29, 0.12);
}

.print-preview-actions button:first-child {
  background: var(--accent);
  color: #ffffff;
}

.print-overlay img {
  align-self: center;
  justify-self: center;
  max-width: 100%;
  max-height: 100%;
  background: #ffffff;
  box-shadow: var(--shadow);
}

@media print {
  @page {
    size: auto;
    margin: 0;
  }

  .editor-shell,
  .toast,
  .print-preview-actions {
    display: none !important;
  }

  html,
  body {
    width: 100%;
    height: 100%;
    overflow: visible;
    background: #ffffff;
  }

  .print-overlay,
  .print-overlay.active {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 0;
    background: #ffffff;
  }

  .print-overlay img {
    display: block;
    width: 100vw;
    height: 100vh;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    box-shadow: none;
  }
}

@media (min-width: 760px) {
  :root {
    --header-h: 76px;
    --dock-h: 96px;
  }

  .top-toolbar {
    padding: calc(env(safe-area-inset-top, 0px) + 10px) 18px 10px;
    gap: 8px;
  }

  .project-title {
    top: calc(env(safe-area-inset-top, 0px) + var(--header-h) / 2);
    width: 270px;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    align-items: center;
    justify-content: center;
    gap: 2px;
    font-size: 27px;
    line-height: 1;
    padding: 5px 20px;
  }

  .project-title small {
    font-size: 11px;
    line-height: 1;
  }

  .header-icon {
    width: 40px;
    height: 40px;
  }

  .canvas-wrap {
    margin: 0;
  }

  .bottom-dock {
    justify-content: center;
    grid-auto-columns: 88px;
    padding-left: 18px;
    padding-right: 18px;
  }

  .dock-button small {
    max-width: 78px;
    font-size: 11px;
  }

  .bottom-sheet {
    left: 50%;
    right: auto;
    width: min(680px, calc(100vw - 32px));
    transform: translate(-50%, 105%);
    border-radius: 24px;
    bottom: calc(var(--dock-h) + 12px);
    padding-bottom: 16px;
  }

  .bottom-sheet.open {
    transform: translate(-50%, 0);
  }

  .floating-toolbar {
    left: 50%;
    right: auto;
    width: min(760px, calc(100vw - 32px));
    transform: translateX(-50%);
    justify-content: center;
  }

  .grid-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 410px) {
  .header-icon {
    width: 36px;
    height: 36px;
    border-width: 2px;
    border-radius: 8px;
    outline-width: 1px;
  }

  .header-icon svg {
    width: 16px;
    height: 16px;
  }

  .bottom-dock {
    grid-auto-columns: 70px;
  }

  .dock-button small {
    max-width: 66px;
  }

  .help-card {
    grid-template-columns: 1fr;
  }

  .help-example {
    width: 100%;
    max-width: 180px;
    justify-self: center;
  }
}

@media (max-width: 360px) {
  .header-icon {
    width: 31px;
    height: 31px;
  }
}

.template-tile .app-template-preview {
  width: 100%;
  height: auto;
  aspect-ratio: 1.42;
  display: block;
  padding: 8% 5%;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
}

.app-template-preview.appCaution,
.app-template-preview.appWarning {
  background: #ffd100;
}

.app-template-preview.appMandatory {
  background: #e8f2ff;
}

.app-template-preview.appProhibition,
.app-template-preview.appFire {
  background: #fff1f1;
}

.app-template-preview.appEmergency {
  background: #eef8f0;
}

.template-tile .app-template-header {
  position: relative;
  width: 100%;
  height: 34%;
  display: grid;
  place-items: center;
  overflow: hidden;
  background: #111111;
  color: #ffffff;
  font-family: "SignAppHeavy", "Arial Black", Arial, sans-serif;
  font-size: clamp(8px, 2.4vw, 15px);
  font-style: normal;
  line-height: 1;
}

.appCaution .app-template-header,
.appWarning .app-template-header {
  color: #ffd100;
}

.appNotice .app-template-header {
  background: #0057a8;
}

.appMandatory .app-template-header {
  background: #0057a8;
}

.appProhibition .app-template-header,
.appFire .app-template-header {
  background: #e2231a;
}

.appEmergency .app-template-header {
  background: #00843d;
}

.appDanger .app-template-header i {
  position: absolute;
  inset: 17% 12%;
  border: 2px solid #ffffff;
  border-radius: 50%;
  background: #d71920;
}

.appDanger .app-template-header b {
  position: relative;
  z-index: 1;
}

.appWarning .app-template-header {
  grid-template-columns: 1fr auto;
  padding-left: 10%;
}

.appWarning .app-template-header em {
  margin-right: 12%;
  color: #111111;
  font-size: 0.8em;
  font-style: normal;
  background: #ffd100;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  padding: 0.35em 0.55em 0.18em;
}

.bottom-sheet.centered-panel {
  left: 50%;
  right: auto;
  top: 50%;
  bottom: auto;
  width: min(980px, calc(100vw - 30px));
  max-width: calc(100vw - 30px);
  height: min(78vh, 720px);
  max-height: min(78vh, 720px);
  margin-left: calc(-1 * min(490px, calc((100vw - 30px) / 2)));
  margin-top: calc(-1 * min(39vh, 360px));
  transform: none;
}

.bottom-sheet.centered-panel.open {
  transform: none;
}

@media (max-width: 720px) {
  .bottom-sheet.centered-panel {
    width: calc(100vw - 20px);
    max-width: calc(100vw - 20px);
    height: min(82vh, 700px);
    max-height: min(82vh, 700px);
  }
}

.bottom-sheet.centered-panel,
.bottom-sheet.centered-panel.open {
  left: max(15px, calc((100vw - 980px) / 2)) !important;
  right: auto;
  top: max(20px, calc((100vh - min(78vh, 720px)) / 2)) !important;
  bottom: auto !important;
  width: min(980px, calc(100vw - 30px));
  height: min(78vh, 720px);
  max-height: min(78vh, 720px);
  margin: 0;
  transform: none !important;
}

@media (max-width: 720px) {
  .bottom-sheet.centered-panel,
  .bottom-sheet.centered-panel.open {
    left: 10px !important;
    top: max(16px, calc((100vh - min(82vh, 700px)) / 2)) !important;
    width: calc(100vw - 20px);
    height: min(82vh, 700px);
    max-height: min(82vh, 700px);
  }
}
