@font-face {
  font-family: "Material Icons";
  src: url("./vendor/MaterialIcons-Regular.ttf") format("truetype");
  font-display: block;
}
:root {
  --bg: #f6f7f8;
  --text: #293038;
  --muted: #939ba3;
  --border: #e8ecef;
  --accent: #32856d;
  --soft: #edf5f1;
  --danger: #b96a60;
  font:
    13px -apple-system,
    BlinkMacSystemFont,
    "PingFang SC",
    "Microsoft YaHei",
    sans-serif;
  color: var(--text);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
}
button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}
button,
summary {
  cursor: pointer;
}
button {
  background: none;
  border: 0;
}
button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
a {
  color: inherit;
  text-decoration: none;
}
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: #8bb8a6 !important;
  box-shadow: 0 0 0 3px #32856d0a;
}
svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
.svg-defs {
  display: none;
}
[hidden] {
  display: none !important;
}
.icon-button {
  width: 32px;
  height: 32px;
  display: inline-grid;
  place-items: center;
  border-radius: 6px;
  color: #818a92;
}
.icon-button > span {
  display: none;
}
.icon-button:hover:not(:disabled) {
  background: #eef2f1;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 13px;
  border: 1px solid #dfe5e8;
  background: white;
  border-radius: 7px;
  font-size: 12px;
  white-space: nowrap;
}
.button:hover:not(:disabled) {
  background: #f5f9f7;
  border-color: #bfd0c6;
}
.button svg {
  width: 16px;
  height: 16px;
}
.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}
.primary:hover:not(:disabled) {
  background: #286f5a;
  color: white;
  border-color: #286f5a;
}
.app-header {
  height: 76px;
  background: white;
  display: flex;
  align-items: center;
  padding: 0 32px;
  gap: 26px;
  border-bottom: 1px solid var(--border);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  height: 38px;
  width: 38px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  border-radius: 11px;
}
.brand-mark svg {
  width: 24px;
  height: 24px;
  transform: rotate(-12deg);
}
.brand-name {
  font-size: 23px;
  font-weight: 650;
  letter-spacing: 2px;
  display: flex;
  align-items: baseline;
  gap: 12px;
}
.brand-name span {
  font-size: 12px;
  letter-spacing: 0.5px;
  font-weight: 400;
  color: #81878f;
}
.header-divider {
  height: 22px;
  width: 1px;
  background: var(--border);
}
.header-caption {
  color: #939ba3;
  font-size: 12px;
  letter-spacing: 1px;
}
.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 22px;
}
.local-badge {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #7b8880;
  font-size: 11px;
}
.local-badge i {
  height: 6px;
  width: 6px;
  background: #81aa95;
  border-radius: 50%;
}
.document-bar {
  height: 68px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--border);
  background: #fafbfc;
}
.document-name {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.document-name > svg {
  color: #9099a2;
  width: 17px;
}
.document-name input {
  border: 1px solid transparent;
  background: transparent;
  width: 155px;
  font-weight: 550;
  padding: 6px;
  border-radius: 5px;
  min-width: 80px;
}
.document-name input:hover {
  border-color: var(--border);
}
.save-status {
  font-size: 11px;
  color: #a0a8b0;
}
.save-status:before {
  content: "✓";
  margin-right: 5px;
  color: #879c90;
}
.document-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.history-actions {
  display: flex;
  gap: 1px;
  border-right: 1px solid #dfe3e7;
  padding-right: 12px;
  margin-right: 4px;
}
.studio {
  display: grid;
  grid-template-columns: 236px minmax(320px, 1fr) 282px;
  min-height: calc(100vh - 182px);
  align-items: stretch;
}
.library {
  background: #fff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.library-tabs {
  display: flex;
  height: 57px;
  border-bottom: 1px solid var(--border);
  padding: 0 17px;
  gap: 5px;
  flex-shrink: 0;
}
.library-tabs button {
  flex: 1;
  color: #939ba3;
  font-size: 12px;
  position: relative;
}
.library-tabs button.active {
  color: var(--accent);
  font-weight: 600;
}
.library-tabs button.active:after {
  content: "";
  height: 2px;
  background: var(--accent);
  position: absolute;
  bottom: 0;
  left: 21%;
  right: 21%;
}
.library-content {
  padding: 20px 17px;
  max-height: calc(100vh - 240px);
  overflow: auto;
  scrollbar-width: thin;
}
.new-label {
  border: 1px dashed #d4ddd8;
  border-radius: 8px;
  height: 47px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 7px;
  color: #557267;
  padding: 0 13px;
  font-size: 12px;
}
.new-label svg {
  width: 16px;
}
.new-label span {
  font-size: 10px;
  color: #a0aaa5;
  margin-left: auto;
}
.new-label:hover {
  background: var(--soft);
}
.section-caption {
  font-size: 11px;
  color: #a0a8b0;
  margin: 25px 0 12px;
}
.category-tabs {
  display: flex;
  gap: 3px;
  margin: 0 0 18px;
}
.category-tabs button {
  font-size: 11px;
  flex: 1;
  padding: 5px 0;
  border-radius: 5px;
  color: #939ba3;
}
.category-tabs button.active {
  background: var(--soft);
  color: var(--accent);
}
.template-grid {
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.template-card {
  display: block;
  text-align: left;
  padding: 0;
  width: 100%;
  border-radius: 8px;
}
.template-art {
  height: 81px;
  border: 1px solid #ecefeb;
  background: #f7f8f5;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}
.template-card:hover .template-art {
  border-color: #a8c9b9;
  background: #f0f5f1;
}
.tiny-label {
  font-size: 14px;
  font-weight: 600;
  color: #454b46;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 7px;
  background: #fff;
  padding: 8px 16px;
  border-radius: 2px;
  box-shadow: 0 2px 5px #27322a0a;
}
.tiny-label .material-icons {
  font-size: 17px;
}
.tiny-label small {
  font-size: 8px;
  letter-spacing: 1px;
  font-weight: 400;
}
.template-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 1px 0;
  font-size: 11px;
  color: #7e8790;
}
.template-caption small {
  font-size: 10px;
  color: #a6adb4;
}
.library-footer {
  margin-top: auto;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 19px;
  color: #a1a8ae;
  font-size: 10px;
  border-top: 1px solid var(--border);
}
.library-footer svg {
  width: 13px;
  height: 13px;
}
.section-description {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 18px;
  line-height: 1.8;
}
.search-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px;
  font-size: 11px;
  background: #fafbfc;
  margin-bottom: 16px;
}
.icon-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 7px;
}
.icon-choice {
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 7px;
}
.icon-choice:hover {
  background: var(--soft);
  border-color: #aec8bb;
}
.material-icons {
  font-family: "Material Icons";
  font-weight: 400;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  display: inline-block;
  white-space: nowrap;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}
.icon-choice .material-icons {
  font-size: 23px;
}
.saved-card {
  border: 1px solid var(--border);
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
}
.saved-card > button:first-child {
  text-align: left;
  flex: 1;
  min-width: 0;
}
.saved-card strong {
  display: block;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.saved-card small {
  display: block;
  color: var(--muted);
  font-size: 10px;
  margin-top: 6px;
}
.remove-saved {
  color: #b3a4a1;
  padding: 6px;
}
.editor {
  min-width: 0;
  padding: 20px 24px;
  background: #f5f6f8;
  display: flex;
  flex-direction: column;
  gap: 15px;
}
.editor-toolbar {
  background: white;
  border: 1px solid var(--border);
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  gap: 12px;
  min-height: 52px;
}
.insert-tools {
  display: flex;
  align-items: center;
  gap: 3px;
}
.insert-button,
.shape-menu > summary {
  height: 37px;
  padding: 0 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 5px;
  font-size: 11px;
  color: #76828c;
  white-space: nowrap;
}
.insert-button:hover,
.shape-menu > summary:hover {
  background: #f3f5f5;
  color: var(--accent);
}
.insert-tools svg {
  width: 16px;
  height: 16px;
}
.shape-menu {
  position: relative;
}
.shape-menu summary {
  list-style: none;
}
.shape-menu summary::-webkit-details-marker {
  display: none;
}
.shape-menu > div {
  position: absolute;
  top: 42px;
  right: 0;
  z-index: 6;
  background: white;
  box-shadow: 0 8px 30px #1c35251a;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px;
  width: 110px;
}
.shape-menu > div button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px;
  border-radius: 5px;
}
.shape-menu > div button:hover {
  background: var(--soft);
}
.preview-switch {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 11px;
  color: #81909a;
  cursor: pointer;
}
.preview-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
}
.switch-track {
  width: 26px;
  height: 15px;
  border-radius: 10px;
  background: #dce0e4;
  position: relative;
}
.switch-track:before {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  top: 2px;
  left: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 2px #0001;
}
.preview-switch input:checked + .switch-track {
  background: var(--accent);
}
.preview-switch input:checked + .switch-track:before {
  transform: translateX(11px);
}
.preview-switch input:focus-visible + .switch-track {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.canvas-area {
  position: relative;
  background-color: #fafbfc;
  background-image: radial-gradient(#d9dfe3 0.7px, transparent 0.7px);
  background-size: 16px 16px;
  border: 1px solid #e6eaed;
  border-radius: 12px;
  flex: 1;
  min-height: 420px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.workspace-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 22px;
  gap: 10px;
}
.workspace-eyebrow {
  font-size: 11px;
  color: #99a3ac;
  letter-spacing: 1px;
}
.paper-badge {
  font-size: 10px;
  color: #9aa4ad;
  display: flex;
  align-items: center;
  gap: 7px;
}
.paper-badge b {
  font-size: 10px;
  font-weight: 500;
  color: #7c8791;
  background: #f0f2f4;
  border: 1px solid #e8ebee;
  padding: 4px 6px;
  border-radius: 4px;
}
.canvas-scroll {
  flex: 1;
  min-width: 0;
  overflow: auto;
  display: flex;
  align-items: center;
  padding: 30px 32px 20px;
  scrollbar-width: thin;
  min-height: 335px;
}
.label-surround {
  flex-shrink: 0;
  margin: auto;
  max-width: none;
}
.ruler {
  height: 24px;
  position: relative;
  border-bottom: 1px solid #d9dfe2;
  background: repeating-linear-gradient(
      to right,
      #cdd4d9 0,
      #cdd4d9 1px,
      transparent 1px,
      transparent 24px
    )
    left bottom/100% 5px no-repeat;
}
.ruler span {
  position: absolute;
  top: 1px;
  font-size: 8px;
  color: #a3adb4;
  transform: translateX(-50%);
  font-variant-numeric: tabular-nums;
}
.paper-row {
  display: flex;
  position: relative;
  margin-top: 14px;
}
.width-dimension {
  position: absolute;
  left: -24px;
  top: 50%;
  font-size: 9px;
  color: #a3adb4;
  writing-mode: vertical-rl;
  transform: rotate(180deg) translateY(50%);
}
.canvas-wrap {
  position: relative;
  background: white;
  box-shadow:
    0 9px 24px #263b4710,
    0 1px 3px #263b4710;
  user-select: none;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 2px;
  touch-action: none;
}
.canvas-wrap canvas {
  display: block;
}
#previewBitmap {
  position: absolute;
  inset: 0;
  z-index: 3;
  image-rendering: pixelated;
  pointer-events: none;
}
.length-dimension {
  margin: 19px 0 0;
  height: 14px;
  border-top: 1px solid #d5dcdf;
  position: relative;
  text-align: center;
}
.length-dimension:before,
.length-dimension:after {
  content: "";
  position: absolute;
  top: -4px;
  height: 7px;
  width: 1px;
  background: #cbd4d9;
}
.length-dimension:before {
  left: 0;
}
.length-dimension:after {
  right: 0;
}
.length-dimension span {
  display: inline-block;
  position: relative;
  top: -9px;
  padding: 0 8px;
  font-size: 9px;
  color: #9ba6ae;
  background: #fafbfc;
}
.canvas-hint {
  text-align: center;
  color: #9da6ad;
  font-size: 11px;
  margin: 6px 0 34px;
  letter-spacing: 0.3px;
}
.canvas-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 17px 16px;
  color: #9ca5ad;
  font-size: 10px;
  gap: 10px;
}
.zoom-control {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #e7eaed;
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}
.zoom-control button {
  height: 26px;
  min-width: 27px;
  padding: 0 7px;
  border-radius: 4px;
  font-size: 11px;
  color: #7f8991;
}
.zoom-control button:hover {
  background: #eff4f1;
}
.zoom-control #zoomValue {
  width: 37px;
  text-align: center;
  font-size: 10px;
}
.zoom-control span:empty {
  height: 13px;
  width: 1px;
  background: var(--border);
  margin: 0 2px;
}
.quick-tip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 2px 0;
}
.tip-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: #eaf0ed;
  color: #79a18e;
  display: grid;
  place-items: center;
}
.tip-icon svg {
  width: 16px;
}
.quick-tip strong {
  font-weight: 500;
  font-size: 11px;
  color: #8a949c;
}
.quick-tip p {
  margin: 6px 0 0;
  font-size: 10px;
  color: #a0a8af;
}
.shortcut-hint {
  margin-left: auto;
  color: #a8b0b7;
  font-size: 9px;
  white-space: nowrap;
}
.shortcut-hint span {
  padding: 0 5px;
}
.item {
  position: absolute;
  cursor: move;
  outline: 1px solid transparent;
  z-index: 2;
  padding: 2px;
  transform-origin: top left;
  touch-action: none;
}
.item.qr-item {
  padding: 0;
}
.item.selected {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
.item.selected:after {
  content: "";
  position: absolute;
  top: -5px;
  left: -5px;
  width: 7px;
  height: 7px;
  border: 1.5px solid var(--accent);
  background: white;
  pointer-events: none;
}
.item .handle {
  position: absolute;
  right: -6px;
  bottom: -6px;
  width: 12px;
  height: 12px;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 2px;
  cursor: nwse-resize;
}
.item:not(.selected) .handle {
  display: none;
}
.item img,
.item svg,
.item canvas {
  display: block;
  pointer-events: none;
}
.rect-shape,
.circle-shape,
.line-shape,
.image-shape {
  display: block;
  pointer-events: none;
}
.line-shape {
  overflow: visible;
}
.image-shape {
  transform-origin: center center;
}
#items.preview-source-hidden {
  visibility: hidden;
  pointer-events: none;
}
.item.icon-item {
  color: #000;
  line-height: 1;
}
.inspector {
  background: #fff;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.properties {
  padding: 22px 22px 12px;
  flex: 1;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 6px;
}
.panel-heading h2 {
  font-size: 12px;
  font-weight: 600;
  margin: 0;
}
.panel-heading > span:not(.device-dot) {
  font-size: 9px;
  padding: 3px 6px;
  background: #f2f4f5;
  border-radius: 4px;
  color: #a0a8af;
}
#panelBody .row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 19px;
}
#panelBody label {
  font-size: 11px;
  color: #939ba4;
}
#panelBody textarea,
#panelBody input:not([type="checkbox"]),
#panelBody select,
.font-picker-button {
  border: 1px solid #e2e7ea;
  background: #fafbfc;
  border-radius: 6px;
  padding: 10px;
  width: 100%;
  font-size: 12px;
  min-width: 0;
}
#panelBody textarea {
  resize: vertical;
  min-height: 82px;
  line-height: 1.7;
}
#panelBody input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
}
#panelBody .settings-row {
  display: flex;
  gap: 12px;
}
#panelBody .settings-row > .row {
  flex: 1;
  min-width: 0;
}
#panelBody .empty {
  font-size: 11px;
  color: #99a1a8;
  line-height: 1.8;
}
#panelBody .secondary {
  color: var(--accent);
  font-size: 10px;
  text-align: left;
  padding: 3px 0;
  width: fit-content;
}
#panelBody .secondary:hover {
  text-decoration: underline;
}
#panelBody .delete {
  width: 100%;
  color: #b2817c;
  font-size: 11px;
  border: 1px solid #f0e4e2;
  border-radius: 6px;
  padding: 9px;
  background: #fdfafa;
  margin-top: 4px;
}
.font-picker {
  position: relative;
}
.font-picker-button {
  display: flex;
  justify-content: space-between;
  text-align: left;
  gap: 5px;
  align-items: center;
}
.font-picker-button span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.font-picker-list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 10;
  max-height: 240px;
  overflow: auto;
  box-shadow: 0 8px 24px #0001;
  border: 1px solid var(--border);
  background: white;
  border-radius: 7px;
  padding: 5px;
}
.font-picker-option {
  display: block;
  text-align: left;
  width: 100%;
  padding: 9px;
  border-radius: 4px;
  font-size: 12px;
}
.font-picker-option:hover,
.font-picker-option[aria-selected="true"] {
  background: var(--soft);
  color: var(--accent);
}
.element-actions {
  display: flex;
  gap: 6px;
  margin: 3px 0 15px;
}
.element-actions button {
  flex: 1;
  font-size: 10px;
  padding: 7px 3px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: #8b959e;
}
.element-actions button:hover {
  color: var(--accent);
  background: var(--soft);
}
.printer-section {
  padding: 23px 22px 18px;
  border-top: 1px solid var(--border);
}
.device-dot {
  width: 6px;
  height: 6px;
  background: #c9cfd3;
  border-radius: 50%;
}
.device-dot.connected {
  background: #5f9f7d;
}
.device-info {
  display: flex;
  align-items: center;
  gap: 13px;
}
.device-info strong {
  font-size: 11px;
  font-weight: 500;
}
.device-info small {
  display: block;
  font-size: 9px;
  color: #9da6ad;
  letter-spacing: 0.5px;
  margin-top: 6px;
}
.mini-printer {
  height: 43px;
  width: 38px;
  border: 1px solid #e1e5e7;
  border-radius: 9px;
  background: linear-gradient(110deg, #fff, #f0f2f3);
  box-shadow: 2px 4px 5px #00000008;
  position: relative;
  transform: rotate(-7deg);
}
.mini-printer:before {
  content: "";
  position: absolute;
  top: 6px;
  left: 7px;
  right: 7px;
  height: 3px;
  background: #d6dcde;
  border-radius: 3px;
}
.mini-printer:after {
  content: "";
  position: absolute;
  bottom: 7px;
  right: 6px;
  width: 3px;
  height: 3px;
  background: #9cb6a8;
  border-radius: 50%;
}
.mini-printer span {
  position: absolute;
  width: 15px;
  height: 17px;
  left: 10px;
  top: 7px;
  background: white;
  border: 1px solid #e4e8e8;
}
.connection-state {
  font-size: 10px;
  color: #a3aab0;
  margin: 17px 0 10px;
}
.connection-state.connected {
  color: var(--accent);
}
.connect-button {
  width: 100%;
  background: #fbfcfc;
  color: #5e7e70;
  font-size: 11px;
}
.print-button {
  width: 100%;
  margin-top: 15px;
  padding: 12px;
  font-size: 12px;
}
.macro-button {
  font-size: 9px;
  color: #9da6ad;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 0 0;
}
.macro-button:hover {
  color: var(--accent);
}
.browser-hint {
  font-size: 10px;
  line-height: 1.7;
  color: #a08b6f;
  margin: 10px 0;
}
.app-footer {
  height: 38px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 9px;
  color: #9da5ad;
  background: #fff;
  border-top: 1px solid var(--border);
  gap: 12px;
}
.app-footer > span:first-child {
  display: flex;
  align-items: center;
  gap: 6px;
}
.app-footer i {
  height: 5px;
  width: 5px;
  background: #a0b7aa;
  border-radius: 50%;
}
.app-footer a {
  margin-left: 20px;
  color: #89958d;
}
.app-footer a:hover {
  text-decoration: underline;
}
#toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translate(-50%, 15px);
  max-width: min(90vw, 560px);
  padding: 12px 20px;
  border-radius: 9px;
  background: #303e38;
  color: #fff;
  font-size: 12px;
  box-shadow: 0 5px 20px #0002;
  z-index: 30;
  opacity: 0;
  pointer-events: none;
  transition: 0.2s;
  line-height: 1.7;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
#toast.error {
  background: #8d5148;
}
dialog {
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 25px 90px #0002;
  padding: 28px;
  max-width: 490px;
  width: calc(100vw - 32px);
  color: var(--text);
}
dialog::backdrop {
  background: #26373340;
  backdrop-filter: blur(3px);
}
.dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dialog-head h2 {
  font-size: 19px;
  font-weight: 600;
  margin: 0;
}
.dialog-head .icon-button {
  font-size: 25px;
}
dialog p {
  color: #8a949a;
  font-size: 12px;
  line-height: 1.9;
}
dialog ol {
  padding-left: 20px;
}
dialog li {
  padding: 9px 0;
  color: var(--accent);
}
dialog li b {
  display: block;
  color: var(--text);
  font-size: 12px;
  margin-bottom: 6px;
}
dialog li span {
  color: #89939a;
  line-height: 1.8;
  font-size: 12px;
}
dialog .help-note {
  background: #f4f7f5;
  border-radius: 8px;
  padding: 12px;
  font-size: 11px;
}
dialog a {
  font-size: 10px;
  color: var(--accent);
}
@media (min-width: 1550px) {
  .studio {
    grid-template-columns: 258px minmax(400px, 1fr) 302px;
  }
  .editor {
    padding: 24px 32px;
  }
  .library-content {
    padding: 22px;
  }
  .template-art {
    height: 93px;
  }
  .properties,
  .printer-section {
    padding-left: 26px;
    padding-right: 26px;
  }
}
@media (max-width: 1260px) {
  .studio {
    grid-template-columns: 206px minmax(300px, 1fr) 250px;
  }
  .editor {
    padding: 16px;
  }
  .properties,
  .printer-section {
    padding-left: 17px;
    padding-right: 17px;
  }
  .insert-button,
  .shape-menu > summary {
    padding: 0 7px;
  }
  .insert-button span,
  .shape-menu > summary span {
    display: none;
  }
  .shortcut-hint,
  .header-caption {
    display: none;
  }
  .library-content {
    padding: 17px 14px;
  }
}
@media (max-width: 1000px) {
  .studio {
    grid-template-columns: 176px minmax(280px, 1fr) 230px;
  }
  .editor {
    padding: 12px;
  }
  .library-tabs {
    padding: 0 8px;
  }
  .tiny-label {
    padding: 8px;
    font-size: 12px;
  }
  .library-content {
    padding: 15px 10px;
  }
  .preview-switch {
    font-size: 10px;
    gap: 5px;
  }
  .editor-toolbar {
    padding: 5px;
    gap: 3px;
  }
  .insert-button,
  .shape-menu > summary {
    padding: 0 6px;
  }
  .header-divider {
    display: none;
  }
  .app-header {
    height: 66px;
    padding: 0 20px;
  }
  .document-bar {
    height: 62px;
    padding: 0 16px;
  }
  .save-status {
    display: none;
  }
  .studio {
    min-height: calc(100vh - 166px);
  }
  .properties,
  .printer-section {
    padding-left: 15px;
    padding-right: 15px;
  }
  .canvas-scroll {
    padding-left: 23px;
    padding-right: 16px;
  }
}
@media (max-width: 760px) {
  .app-header {
    height: 62px;
    padding: 0 16px;
  }
  .brand-name {
    font-size: 21px;
  }
  .brand-name span {
    font-size: 10px;
  }
  .header-actions {
    gap: 8px;
  }
  .local-badge {
    display: none;
  }
  .document-bar {
    height: auto;
    min-height: 67px;
    padding: 12px;
    flex-wrap: wrap;
    gap: 9px;
  }
  .document-name input {
    width: 135px;
  }
  .document-actions {
    gap: 5px;
  }
  .document-actions .button {
    padding: 8px;
    font-size: 10px;
  }
  .history-actions {
    padding-right: 5px;
    margin-right: 0;
  }
  .studio {
    display: flex;
    flex-wrap: wrap;
  }
  .library {
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  .library-tabs {
    height: 42px;
    max-width: 260px;
    margin: auto;
    width: 100%;
  }
  .library-content {
    max-height: none;
    padding: 13px 14px;
  }
  .new-label {
    width: 140px;
    height: 36px;
    display: inline-flex;
  }
  .new-label span,
  .section-caption {
    display: none;
  }
  .category-tabs {
    display: inline-flex;
    width: 180px;
    margin: 0 0 0 10px;
  }
  .template-grid {
    flex-direction: row;
    overflow: auto;
    margin-top: 13px;
    gap: 10px;
  }
  .template-card {
    width: 153px;
    flex-shrink: 0;
  }
  .template-art {
    height: 66px;
  }
  .template-caption {
    font-size: 10px;
  }
  .library-footer {
    display: none;
  }
  .editor {
    width: 100%;
    padding: 14px 12px;
  }
  .canvas-area {
    min-height: 380px;
  }
  .canvas-scroll {
    min-height: 260px;
  }
  .canvas-hint {
    margin-bottom: 20px;
    font-size: 10px;
  }
  .quick-tip {
    padding: 2px;
  }
  .editor-toolbar {
    padding: 6px;
  }
  .insert-tools {
    gap: 6px;
  }
  .insert-button,
  .shape-menu > summary {
    padding: 0 7px;
  }
  .inspector {
    width: 100%;
    border-top: 1px solid var(--border);
    border-left: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .properties {
    padding: 20px 16px;
  }
  .printer-section {
    padding: 20px 16px;
    border-top: 0;
    border-left: 1px solid var(--border);
  }
  .app-footer {
    padding: 12px;
    height: auto;
    font-size: 9px;
  }
  .app-footer > span:last-child {
    font-size: 0;
  }
  .app-footer a {
    font-size: 9px;
    margin-left: 0;
  }
  .icon-grid {
    grid-template-columns: repeat(8, 1fr);
  }
  #savedGrid {
    display: flex;
    gap: 10px;
    overflow: auto;
  }
  .saved-card {
    min-width: 180px;
    margin: 0;
  }
  .section-description {
    margin-bottom: 10px;
  }
  .panel-heading {
    margin-bottom: 18px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
@media (min-width: 761px) {
  .studio {
    height: calc(100vh - 182px);
    min-height: 0;
    overflow: hidden;
  }
  .library-content {
    flex: 1;
    min-height: 0;
    max-height: none;
  }
  .library-footer {
    flex-shrink: 0;
  }
  .editor {
    overflow: hidden;
  }
  .editor-toolbar,
  .quick-tip {
    flex-shrink: 0;
  }
  .canvas-area {
    min-height: 0;
  }
  .canvas-scroll {
    min-height: 0;
    padding: 20px 32px;
  }
  .canvas-hint {
    margin: 8px 0 18px;
  }
  .workspace-heading {
    padding: 16px 20px;
  }
  .properties {
    min-height: 0;
    overflow: auto;
    scrollbar-width: thin;
    padding-top: 18px;
  }
  .printer-section {
    flex-shrink: 0;
    padding-top: 16px;
    padding-bottom: 14px;
  }
  .printer-section .panel-heading {
    margin-bottom: 15px;
  }
  .printer-section .connection-state {
    margin-top: 12px;
  }
  .panel-heading {
    margin-bottom: 17px;
  }
  #panelBody .row {
    margin-bottom: 13px;
    gap: 6px;
  }
  #panelBody textarea {
    min-height: 64px;
  }
  #panelBody .element-actions {
    margin-bottom: 10px;
  }
  .quick-tip {
    padding-top: 3px;
  }
  .new-label {
    flex-shrink: 0;
  }
}
@media (min-width: 761px) and (max-width: 1000px) {
  .studio {
    height: calc(100vh - 166px);
  }
}
@media (min-width: 761px) {
  .studio {
    grid-template-rows: minmax(0, 1fr);
  }
  .library,
  .inspector,
  .editor {
    min-height: 0;
  }
  .library,
  .inspector {
    overflow: hidden;
  }
  .canvas-area {
    flex: 1 1 0;
  }
  .canvas-scroll {
    flex: 1 1 0;
  }
}

@media (min-width: 761px) {
  #panelBody textarea {
    height: 60px;
    min-height: 52px;
  }
  #panelBody .row {
    margin-bottom: 11px;
  }
  .properties .panel-heading {
    margin-bottom: 14px;
  }
}
.icon-library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.icon-library-heading strong {
  font-size: 15px;
  letter-spacing: 0.2px;
  font-weight: 600;
}
.icon-library-heading span {
  font-size: 10px;
  color: var(--accent);
  background: var(--soft);
  padding: 3px 6px;
  border-radius: 4px;
}
#iconCount {
  margin-bottom: 14px;
  font-size: 10px;
}
#iconSearch {
  margin-bottom: 9px;
}
.icon-category {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px;
  background: #fafbfc;
  font-size: 11px;
}
.icon-results {
  color: var(--muted);
  font-size: 10px;
  margin: 14px 0 11px;
  font-variant-numeric: tabular-nums;
}
.icon-choice .lucide-icon {
  pointer-events: none;
  opacity: 0.78;
}
.icon-choice:hover .lucide-icon {
  opacity: 1;
}
.icon-choice:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.more-icons {
  width: 100%;
  margin-top: 16px;
  font-size: 11px;
}
.icon-empty {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.9;
  padding: 12px 0;
}
.icon-empty button {
  font-size: 11px;
}
.icon-replace-notice {
  background: var(--soft);
  border-radius: 6px;
  font-size: 10px;
  color: var(--accent);
  padding: 10px;
  margin-top: 12px;
  line-height: 1.7;
}
.icon-replace-notice button {
  display: block;
  padding: 4px 0 0;
  font-size: 10px;
  text-decoration: underline;
}
.selected-icon-info {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: #fafbfc;
}
.selected-icon-info > span {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.selected-icon-info > div {
  min-width: 0;
}
.selected-icon-info strong {
  font-size: 12px;
  font-weight: 500;
  display: block;
  overflow-wrap: anywhere;
}
.selected-icon-info small {
  font-size: 10px;
  color: var(--muted);
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
}
#panelBody .replace-icon-button {
  margin: 0 0 18px;
}
@media (max-width: 760px) {
  #iconCount {
    margin-bottom: 12px;
  }
  .icon-choice {
    min-width: 0;
    height: 37px;
  }
  .icon-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .icon-choice .lucide-icon {
    max-width: 24px;
    max-height: 24px;
  }
  .more-icons {
    width: auto;
    padding: 8px 16px;
    display: block;
    margin: 16px auto 0;
  }
}
/* Native text selection and IME, aligned with the label's existing print canvas. */
.item.text-item {
  min-width: 24px;
  min-height: 24px;
}
.item.text-item:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.item.is-text-editing {
  cursor: text;
  z-index: 5;
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  box-shadow: 0 0 0 4px #32856d12;
}
.item.is-text-editing:after {
  display: none;
}
.item.is-text-editing > canvas {
  visibility: hidden;
}
.canvas-wrap:has(.is-text-editing),
.item.is-text-editing {
  touch-action: auto;
}
.inline-text-layer {
  position: absolute;
  left: 2px;
  top: 2px;
  overflow: hidden;
}
.inline-text-decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.inline-text-editor {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  padding: 0;
  border: 0;
  box-sizing: content-box;
  min-width: 0;
  min-height: 0;
  border-radius: 0;
  outline: none !important;
  box-shadow: none !important;
  background: transparent;
  color: #000;
  -webkit-text-fill-color: #000;
  caret-color: var(--accent);
  resize: none;
  overflow: auto;
  scrollbar-width: none;
  white-space: pre;
  overflow-wrap: normal;
  word-break: normal;
  tab-size: 8;
  letter-spacing: normal;
  text-align: left;
  text-indent: 0;
  cursor: text;
  user-select: text;
  -webkit-user-select: text;
  touch-action: auto;
  -webkit-appearance: none;
  appearance: none;
}
.inline-text-editor::-webkit-scrollbar {
  display: none;
}
.inline-text-editor::selection {
  background: #32856d38;
  color: #000;
}
.canvas-hint.editing-hint {
  color: var(--accent);
  font-size: 10px;
  line-height: 1.8;
  padding: 0 12px;
}
