:root {
  --page-w: 210mm;
  --page-h: 297mm;
  --zoom: 1;
  --page-screen-w: 794px;
  --page-screen-h: 1123px;
  --grid-mm: 50mm;
  --side-w: 440px;
  --corner-gap: 18px;
  --corner-pad: 12px;
  --desk: #5b9c9f42;
  --desk-dark: #5b9c9f42;
  --panel: #fbfcfd;
  --panel-line: #cfd7e1;
  --ink: #111827;
  --muted: #667085;
  --accent: #0f6d8f;
  --accent-2: #c0462b;
  --paper: #fff;
  --grid-major: rgba(30, 64, 91, .10);
  --risk: rgba(192, 70, 43, .10);
  --risk-line: rgba(192, 70, 43, .42);
  --bleed-line: rgba(15, 109, 143, .55);
  --bleed-fill: rgba(15, 109, 143, .055);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  background: var(--desk);
}

button,
input,
select {
  font: inherit;
}

.app {
  display: grid;
  grid-template-columns: 1fr var(--side-w);
  grid-template-rows: auto 1fr;
  width: 100%;
  height: 100%;
}

.toolbar {
  position: relative;
  display: flex;
  grid-column: 2;
  grid-row: 1;
  flex-direction: row;
  align-items: flex-start;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 7px;
  width: var(--side-w);
  height: auto;
  min-height: 0;
  padding: 8px 10px 7px;
  background: #edf2f6;
  border-left: 1px solid #c8d2dc;
  border-bottom: 1px solid #c8d2dc;
  box-shadow: -1px 0 8px rgba(15, 23, 42, .08);
  overflow: visible;
  white-space: normal;
  z-index: 20;
}

.brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex: 0 0 auto;
  width: auto;
  font-weight: 700;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 7px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fff;
  background: #222831;
  border: 1px solid #111827;
  font-size: 14px;
}

.brand-name {
  font-size: 15px;
}

.brand-print-mark {
  display: flex;
  align-items: center;
  gap: 5px;
  color: #405066;
  font-size: 11px;
  font-weight: 400;
  line-height: 1;
  white-space: nowrap;
}

.brand-print-mark input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.tool-group {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  width: 100%;
  padding: 0;
  border-left: 0;
  border-top: 0;
}

.toolbar > .tool-group:not(.language-tools) > .btn,
.toolbar > .tool-group:not(.language-tools) > .icon-btn {
  flex: 1 1 0;
  min-width: 0;
}

.toolbar > .tool-group:not(.language-tools) > .btn .btn-label,
.toolbar > .tool-group:not(.language-tools) > .icon-btn .btn-label {
  max-width: 100%;
}

.tool-caption {
  color: #405066;
  font-size: 12px;
  font-weight: 700;
}

.toolbar-break {
  flex-basis: 100%;
  width: 0;
  height: 0;
}

.tool-group.primary {
  border-top: 0;
  align-self: flex-start;
  flex: 1 1 100%;
  flex-wrap: wrap;
  margin-top: 1px;
}

.tool-group.primary .btn {
  min-width: 0;
  padding: 0 6px;
}

.tool-group.primary .btn-label {
  max-width: 64px;
}

#addBtn {
  flex-grow: 1.7;
}

#addBtn .btn-label {
  max-width: 134px;
}

#printBtn {
  color: #fff;
  background: #6d4bd3;
  border-color: #5b39bd;
}

#saveAsBtn {
  color: #fff;
  background: #1f6f52;
  border-color: #17543f;
}

.project-actions {
  position: absolute;
  top: 8px;
  right: 10px;
  z-index: 2;
  width: auto;
  flex-direction: column;
  gap: 3px;
}

.toolbar > .project-actions > .btn {
  flex: 0 0 auto;
  width: 74px;
  min-height: 23px;
  padding: 0 5px;
  font-size: 11px;
}

.project-actions .btn-label {
  display: inline;
  max-width: 52px;
}

#saveAsBtn {
  flex-grow: 1;
  min-width: 0;
}

#saveAsBtn .btn-label {
  max-width: 104px;
}

.save-format-label {
  gap: 0;
}

.save-format-label select {
  min-width: 58px;
  max-width: 66px;
  padding: 0 4px;
}

.tool-group.end {
  margin-left: auto;
  margin-top: 0;
}

.quick-actions {
  flex-basis: 100%;
  flex-wrap: nowrap;
  gap: 4px;
}

.quick-actions .icon-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 0 5px;
}

.quick-actions .btn-label {
  max-width: 78px;
}

.language-tools,
.grid-picker {
  position: fixed;
  right: calc(var(--side-w) + var(--corner-gap));
  left: auto;
  z-index: 45;
  min-height: 30px;
  margin: 0;
  padding: 0;
  color: rgba(255, 255, 255, .92);
  background: transparent;
  border: 0;
  border-radius: 8px;
  box-shadow: none;
  backdrop-filter: none;
  white-space: nowrap;
  transform: translateZ(0);
}

.language-tools {
  top: var(--corner-pad);
  bottom: auto;
  display: inline-flex;
  align-items: center;
  width: auto;
}

.language-tools .select-label {
  gap: 0;
  justify-content: flex-end;
}

.language-tools .select-label span {
  display: none;
}

.language-tools select {
  min-height: 24px;
  padding: 0 18px 0 8px;
  color: #1f2937;
  background: rgba(255, 255, 255, .92);
  border: 0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 5px 14px rgba(15, 23, 42, .14), inset 0 0 0 1px rgba(255, 255, 255, .55);
}

.language-tools select option,
.grid-picker select option {
  color: #1f2937;
  background: #fff;
}

.language-tools select:focus-visible,
.grid-picker select:focus-visible,
.grid-picker input:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .58);
  outline-offset: 2px;
}

.btn,
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 32px;
  border: 1px solid #b8c4cf;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  border-radius: 5px;
  box-shadow: 0 1px 0 rgba(15, 23, 42, .04);
}

.btn {
  width: auto;
  padding: 0 7px;
}

.btn.compact {
  padding: 0 7px;
  min-height: 31px;
}

.btn.full {
  width: 100%;
}

.btn.strong {
  background: var(--accent);
  color: #fff;
  border-color: #095a78;
}

.btn.active {
  background: #d9eef2;
  border-color: var(--accent);
  color: #0b5f7d;
}

.icon-btn {
  width: auto;
  min-width: 72px;
  padding: 0 7px;
  font-size: 13px;
  line-height: 1;
}

.btn-ico {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  min-width: 15px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
}

.btn-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn:disabled,
.icon-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.select-label,
.check-line {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #334155;
  font-size: 13px;
}

.toolbar .select-label {
  flex-direction: row;
  align-items: center;
  width: auto;
  gap: 4px;
  text-align: left;
}

.select-label.full {
  justify-content: space-between;
  width: 100%;
}

select,
input[type="number"] {
  min-height: 30px;
  border: 1px solid #bdc8d4;
  background: #fff;
  border-radius: 5px;
}

.toolbar select {
  width: auto;
  min-width: 0;
}

.zoom-range {
  width: 88px;
  accent-color: var(--accent);
}

input[type="number"] {
  width: 82px;
  padding: 0 7px;
}

input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
}

.main {
  display: contents;
}

.workspace-wrap {
  grid-column: 1;
  grid-row: 1 / 3;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  background: var(--desk);
}

.workspace {
  position: relative;
  min-width: calc(var(--page-screen-w) + 108px);
  min-height: calc(var(--page-screen-h) + 82px);
  padding: 38px 52px 34px 52px;
}

.page-shell {
  width: var(--page-w);
  height: var(--page-h);
  transform: scale(var(--zoom));
  transform-origin: top left;
  box-shadow: 0 20px 55px rgba(0, 0, 0, .28);
}

.page {
  position: relative;
  width: var(--page-w);
  height: var(--page-h);
  overflow: hidden;
  background: var(--paper);
}

.grid-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.grid-svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.grid-line {
  stroke: var(--grid-major);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
  shape-rendering: crispEdges;
}

body.grid-off .grid-layer {
  display: none;
}

.risk-layer {
  position: absolute;
  pointer-events: none;
  border: 1px dashed var(--risk-line);
  background:
    linear-gradient(var(--risk), var(--risk)) top / 100% var(--risk-top, 5mm) no-repeat,
    linear-gradient(var(--risk), var(--risk)) bottom / 100% var(--risk-bottom, 5mm) no-repeat,
    linear-gradient(var(--risk), var(--risk)) left / var(--risk-left, 5mm) 100% no-repeat,
    linear-gradient(var(--risk), var(--risk)) right / var(--risk-right, 5mm) 100% no-repeat;
  inset: 0;
}

.bleed-layer {
  position: absolute;
  inset: var(--bleed-mm, 3mm);
  z-index: 3;
  pointer-events: none;
  border: 1px dashed var(--bleed-line);
  box-shadow: 0 0 0 999mm var(--bleed-fill);
}

body.bleed-off .bleed-layer {
  display: none;
}

.items-layer {
  position: absolute;
  inset: 0;
  z-index: 5;
}

.draw-overlay {
  position: absolute;
  inset: 0;
  z-index: 90000;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.print-item {
  position: absolute;
  touch-action: none;
  transform-origin: center center;
  outline: 0;
  overflow: hidden;
}

.print-item img {
  position: absolute;
  display: block;
  pointer-events: none;
  user-select: none;
}

.print-item.selected {
  outline: .35mm solid var(--accent);
  outline-offset: .45mm;
}

.handle {
  position: absolute;
  width: 13px;
  height: 13px;
  background: #fff;
  border: 2px solid var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  touch-action: none;
}

.handle.nw { left: 0; top: 0; cursor: nwse-resize; }
.handle.n { left: 50%; top: 0; cursor: ns-resize; }
.handle.ne { left: 100%; top: 0; cursor: nesw-resize; }
.handle.e { left: 100%; top: 50%; cursor: ew-resize; }
.handle.se { left: 100%; top: 100%; cursor: nwse-resize; }
.handle.s { left: 50%; top: 100%; cursor: ns-resize; }
.handle.sw { left: 0; top: 100%; cursor: nesw-resize; }
.handle.w { left: 0; top: 50%; cursor: ew-resize; }

.rotate-handle {
  position: absolute;
  left: 50%;
  top: -30px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
  font-size: 14px;
  line-height: 1;
}

.rotate-handle::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1px;
  height: 23px;
  background: var(--accent);
  transform: translateX(-50%);
}

.ruler {
  position: absolute;
  background: transparent;
  color: #334155;
  border: 0;
  overflow: hidden;
  z-index: 4;
  pointer-events: none;
  font-size: 13px;
}

.ruler-top {
  left: 52px;
  top: 4px;
  width: var(--page-screen-w);
  height: 30px;
}

.ruler-left {
  left: 8px;
  top: 38px;
  width: 36px;
  height: var(--page-screen-h);
}

.ruler-corner {
  position: absolute;
  left: 8px;
  top: 4px;
  width: 36px;
  height: 30px;
  background: transparent;
  border: 0;
  z-index: 4;
  color: rgba(255, 255, 255, .88);
  font-size: 18px;
  font-weight: 700;
  line-height: 30px;
  text-align: center;
  text-shadow: 0 1px 1px rgba(15, 23, 42, .55);
}

.tick {
  position: absolute;
  background: rgba(255, 255, 255, .55);
}

.tick.major {
  background: rgba(255, 255, 255, .86);
}

.ruler-top .tick {
  bottom: 0;
  width: 1px;
  height: 4px;
}

.ruler-top .tick.middle {
  height: 7px;
}

.ruler-top .tick.major {
  height: 10px;
}

.ruler-left .tick {
  right: 0;
  width: 4px;
  height: 1px;
}

.ruler-left .tick.middle {
  width: 7px;
}

.ruler-left .tick.major {
  width: 10px;
}

.ruler-label {
  position: absolute;
  color: rgba(255, 255, 255, .88);
  font-size: 13px;
  line-height: 1;
  text-shadow: 0 1px 1px rgba(15, 23, 42, .55);
}

.ruler-top .ruler-label {
  top: 0;
  transform: translateX(-50%);
}

.ruler-top .ruler-label.zero {
  transform: none;
}

.ruler-left .ruler-label {
  left: 0;
  width: 24px;
  text-align: right;
  transform: translateY(-50%);
}

.ruler-left .ruler-label.zero {
  top: 2px !important;
  transform: none;
}

.print-mark {
  position: absolute;
  left: 5mm;
  bottom: 4mm;
  z-index: 100000;
  color: rgba(17, 24, 39, .56);
  font-size: 7.5pt;
  pointer-events: none;
}

.print-mark.hidden {
  display: none;
}

.calibration-page {
  position: absolute;
  inset: 0;
  z-index: 200000;
  display: block;
  background: #fff;
  color: #111827;
  pointer-events: none;
}

.calibration-title {
  position: absolute;
  left: 20mm;
  top: 18mm;
  font-size: 15pt;
  font-weight: 700;
}

.calibration-line {
  position: absolute;
  background: #111827;
}

.calibration-horizontal {
  left: 20mm;
  top: 55mm;
  width: 100mm;
  height: .35mm;
}

.calibration-horizontal::before,
.calibration-horizontal::after,
.calibration-vertical::before,
.calibration-vertical::after {
  content: "";
  position: absolute;
  background: #111827;
}

.calibration-horizontal::before,
.calibration-horizontal::after {
  top: -2mm;
  width: .35mm;
  height: 4mm;
}

.calibration-horizontal::before {
  left: 0;
}

.calibration-horizontal::after {
  right: 0;
}

.calibration-vertical {
  left: 20mm;
  top: 75mm;
  width: .35mm;
  height: 100mm;
}

.calibration-vertical::before,
.calibration-vertical::after {
  left: -2mm;
  width: 4mm;
  height: .35mm;
}

.calibration-vertical::before {
  top: 0;
}

.calibration-vertical::after {
  bottom: 0;
}

.calibration-label {
  position: absolute;
  color: #334155;
  font-size: 10pt;
  font-weight: 700;
}

.calibration-label-h {
  left: 56mm;
  top: 59mm;
}

.calibration-label-v {
  left: 26mm;
  top: 121mm;
  transform: rotate(90deg);
  transform-origin: left center;
}

.inspector {
  grid-column: 2;
  grid-row: 2;
  position: relative;
  min-height: 0;
  overflow: visible;
  padding: 8px;
  background: #edf2f6;
  border-left: 1px solid #c8d2dc;
  display: flex;
  flex-direction: column;
}

.panel {
  padding: 9px;
  margin-bottom: 6px;
  background: var(--panel);
  border: 1px solid var(--panel-line);
  border-radius: 6px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.panel h2 {
  margin: 0 0 7px;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 700;
  color: #243447;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 28px;
  color: #243447;
  font-size: 13px;
  font-weight: 700;
}

.panel-title {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.panel-heading-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #243447;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.panel-heading-toggle .btn-ico {
  min-width: 13px;
  color: var(--accent);
}

.layer-heading-tools {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.layer-heading-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 26px;
  padding: 0 5px;
  border: 1px solid #c9d3dc;
  border-radius: 4px;
  background: #fff;
  color: #334155;
  cursor: pointer;
  font-size: 11px;
}

.layer-heading-btn .btn-label {
  max-width: 42px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-heading-btn .btn-ico {
  min-width: 11px;
  font-size: 12px;
}

.layer-heading-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.panel-collapsed .panel-body {
  display: none;
}

.panel-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-height: 28px;
  padding: 0;
  color: #243447;
  background: transparent;
  border: 0;
  box-shadow: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.panel-toggle .btn-ico {
  min-width: 13px;
  color: var(--accent);
}

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

.risk-header .panel-toggle {
  flex: 1 1 auto;
  width: auto;
}

.calibration-inline {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 0 6px;
  font-size: 11px;
}

.calibration-inline .btn-label {
  max-width: 46px;
}

.margin-range {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex: 0 0 auto;
  color: #405066;
  font-size: 11px;
}

.margin-range input {
  width: 88px;
  accent-color: var(--accent);
}

.margin-range span {
  min-width: 22px;
  text-align: right;
}

.risk-fields {
  padding-top: 7px;
}

.empty-note,
.warning,
.toast,
.zoom-readout {
  color: var(--muted);
  font-size: 13px;
}

.warning {
  margin: 10px 0 0;
  color: #a82b16;
}

.compact-warning {
  margin-top: 6px;
  font-size: 12px;
}

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

.field-grid label {
  display: grid;
  gap: 3px;
  color: #405066;
  font-size: 12px;
}

.field-grid input {
  width: 100%;
}

.field-grid .wide {
  grid-column: span 2;
}

.button-row {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.button-row.wrap {
  flex-wrap: wrap;
}

.end-row {
  justify-content: flex-end;
}

.check-line {
  margin: 5px 0;
}

.magic-tools {
  display: grid;
  gap: 6px;
  margin-top: 7px;
}

.angle-tools-row {
  display: grid;
  grid-column: span 2;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 6px;
}

.preset-tools {
  display: grid;
  grid-template-columns: repeat(2, 34px);
  gap: 4px;
}

.preset-tools .btn {
  min-width: 0;
  min-height: 28px;
  padding: 0 2px;
}

.preset-tools .btn-ico {
  display: none;
}

.preset-tools .btn-label {
  max-width: 30px;
  font-size: 11px;
}

.crop-tools {
  display: grid;
  gap: 6px;
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid #e1e7ee;
}

.mini-heading,
.mini-toggle {
  color: #405066;
  font-size: 12px;
  font-weight: 700;
}

.mini-toggle {
  display: flex;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-height: 25px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
}

.mini-toggle .btn-ico {
  min-width: 13px;
  color: var(--accent);
  font-size: 13px;
}

.crop-body {
  display: grid;
  gap: 6px;
}

.crop-grid input {
  min-height: 27px;
}

.magic-btn .btn-ico {
  color: var(--accent);
}

.magic-range {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 24px;
  align-items: center;
  gap: 7px;
  color: #405066;
  font-size: 12px;
}

.magic-range input {
  width: 100%;
  accent-color: var(--accent);
}

.bleed-range,
.brush-range {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 26px;
  align-items: center;
  gap: 7px;
  color: #405066;
  font-size: 12px;
  margin-bottom: 7px;
}

.bleed-range input,
.brush-range input {
  width: 100%;
  accent-color: var(--accent);
}

.draw-panel {
  padding-bottom: 8px;
}

.draw-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding-top: 7px;
}

.draw-grid input[type="color"] {
  width: 100%;
  min-height: 31px;
  padding: 2px;
  border: 1px solid #bdc8d4;
  border-radius: 5px;
  background: #fff;
}

.draw-grid select {
  width: 100%;
}

body.draw-mode .page {
  cursor: crosshair;
}

body.draw-mode .print-item {
  pointer-events: none;
}

#resetMarginsBtn {
  margin-top: 8px;
}

.layers-panel {
  padding-bottom: 7px;
}

.layers-list {
  display: grid;
  gap: 5px;
  max-height: 176px;
  overflow: auto;
  padding-top: 5px;
}

.layer-row {
  display: grid;
  grid-template-columns: 24px 24px minmax(0, 1fr) 34px 24px;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 3px 4px;
  border: 1px solid #d8e0e8;
  background: #fff;
  border-radius: 5px;
  cursor: grab;
}

.layer-row.selected {
  border-color: rgba(15, 109, 143, .72);
  box-shadow: inset 3px 0 0 var(--accent);
}

.layer-row.hidden-layer {
  opacity: .58;
}

.layer-row.dragging {
  opacity: .42;
}

.layer-row.drop-before {
  box-shadow: inset 0 3px 0 var(--accent);
}

.layer-row.drop-after {
  box-shadow: inset 0 -3px 0 var(--accent);
}

.layer-action {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 1px solid #c9d3dc;
  border-radius: 4px;
  background: #fff;
  color: #334155;
  cursor: pointer;
}

.layer-action:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.layer-name {
  min-width: 0;
  padding: 0 2px;
  border: 0;
  background: transparent;
  color: #243447;
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
}

.layer-name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.layer-meta {
  color: #667085;
  font-size: 10px;
}

.layer-index {
  color: #667085;
  font-size: 11px;
  text-align: right;
}

.layer-drag {
  display: grid;
  place-items: center;
  color: #7a8796;
  font-size: 13px;
  cursor: grab;
  user-select: none;
}

.layers-empty {
  padding: 7px 2px 3px;
  color: var(--muted);
  font-size: 12px;
}

.seo-panel {
  padding-top: 8px;
}

.seo-panel p {
  margin: 5px 0 0;
  color: #526173;
  font-size: 11.5px;
  line-height: 1.35;
}

.side-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
}

.grid-picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 11px;
  bottom: var(--corner-pad);
}

.grid-picker input {
  -webkit-appearance: none;
  appearance: none;
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin: 0;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 5px;
  cursor: pointer;
}

.grid-picker input:checked {
  background: #5b9c9f;
  border-color: rgba(255, 255, 255, .38);
}

.grid-picker input:checked::before {
  width: 8px;
  height: 4px;
  border: solid #fff;
  border-width: 0 0 2px 2px;
  content: "";
  transform: rotate(-45deg) translateY(-1px);
}

.grid-picker select {
  min-height: 24px;
  max-width: 66px;
  padding: 0 16px 0 5px;
  color: #1f2937;
  background: rgba(255, 255, 255, .92);
  border: 0;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 5px 14px rgba(15, 23, 42, .14), inset 0 0 0 1px rgba(255, 255, 255, .55);
}

.grid-picker-label {
  display: none;
}

.orientation-label .btn-ico {
  color: var(--accent);
  font-size: 14px;
}

.orientation-icon {
  width: 22px;
  min-width: 22px;
}

.orientation-icon svg {
  display: block;
  width: 22px;
  height: 22px;
  overflow: visible;
}

.orientation-icon-page {
  fill: rgba(255, 255, 255, .78);
  stroke: currentColor;
  stroke-width: 1.35;
}

.orientation-icon-page.ghost {
  fill: rgba(91, 156, 159, .12);
  opacity: .82;
}

.orientation-icon-arrow {
  fill: none;
  stroke: #222831;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.45;
}

.side-credit {
  flex: 0 0 auto;
  margin-left: auto;
  padding: 0 2px;
  color: #667085;
  font-size: 12px;
  text-align: right;
  text-decoration: none;
  white-space: nowrap;
}

.side-credit:hover {
  color: var(--accent);
  text-decoration: underline;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  z-index: 50;
  max-width: min(520px, calc(100vw - 24px));
  padding: 10px 14px;
  color: #fff;
  background: rgba(17, 24, 39, .92);
  border-radius: 6px;
  transform: translateX(-50%);
}

@media (max-width: 960px) {
  body {
    overflow: auto;
  }

  .app {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    min-height: 100vh;
    height: auto;
  }

  .main {
    display: contents;
  }

  .workspace-wrap {
    grid-column: 1;
    grid-row: 3;
    min-height: 70vh;
  }

  .workspace {
    min-width: calc(var(--page-screen-w) + 96px);
    min-height: calc(var(--page-screen-h) + 76px);
    padding: 38px 38px 28px 52px;
  }

  .inspector {
    grid-column: 1;
    grid-row: 2;
    padding: 8px;
    border-left: 0;
    border-top: 1px solid #cbd5df;
  }

  .toolbar {
    grid-column: 1;
    grid-row: 1;
    position: relative;
    width: 100%;
    max-height: none;
    min-height: 60px;
    border-left: 0;
    border-bottom: 1px solid #cfd6de;
  }

  .language-tools {
    position: static;
    inset: auto;
    transform: none;
    order: -2;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .language-tools .select-label {
    gap: 4px;
  }

  .language-tools .select-label span {
    display: inline;
  }

  .language-tools select {
    min-height: 30px;
    color: var(--ink);
    background: #fff;
    border: 0;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
    font-size: 13px;
  }

  .side-footer {
    margin-top: 8px;
  }

  .grid-picker {
    position: static;
    inset: auto;
    transform: none;
    color: #405066;
    background: transparent;
    border: 0;
    box-shadow: none;
    backdrop-filter: none;
    padding: 0;
  }

  .grid-picker select {
    min-height: 28px;
    max-width: 78px;
    color: var(--ink);
    background: #fff;
    border: 0;
    box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
    font-size: 13px;
  }

  .tool-group.end {
    margin-left: 0;
  }
}

@page {
  size: A4 portrait;
  margin: 0;
}

@media print {
  html,
  body {
    width: var(--page-w);
    height: var(--page-h);
    overflow: hidden;
    margin: 0;
    padding: 0;
    background: #fff;
  }

  .app {
    display: block;
    width: var(--page-w);
    height: var(--page-h);
  }

  .app-ui,
  .toolbar,
  .inspector,
  .ruler,
  .ruler-corner,
  .grid-layer,
  .risk-layer,
  .handle,
  .rotate-handle,
  .toast {
    display: none !important;
  }

  .main,
  .workspace-wrap,
  .workspace,
  .page-shell {
    display: block;
    width: var(--page-w) !important;
    height: var(--page-h) !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
    background: #fff !important;
    box-shadow: none !important;
    transform: none !important;
  }

  .page {
    position: absolute;
    left: 0;
    top: 0;
    width: var(--page-w);
    height: var(--page-h);
    overflow: hidden;
    box-shadow: none;
    transform: none !important;
  }

  .print-item {
    outline: 0 !important;
  }

}
