/* ---------- Windows XP Paint ---------- */
.pt-window .window-content.pt-root {
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0 3px;
  width: auto;
  overflow: hidden;
  background: #ece9d8;
  font: 11px Tahoma, "Segoe UI", sans-serif;
  color: #000;
  position: relative;
  outline: none;
  user-select: none;
}

.pt-main {
  flex: 1;
  min-height: 0;
  display: flex;
}

/* Tool box */
.pt-toolbox {
  width: 56px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 0;
  box-sizing: border-box;
  border-top: 1px solid #fff;
}
.pt-tools {
  display: grid;
  grid-template-columns: 25px 25px;
  gap: 0;
}
.pt-root .pt-tool {
  width: 25px;
  height: 25px;
  min-width: 0;
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}
.pt-root .pt-tool:hover {
  border-color: #fff #808080 #808080 #fff;
  background: transparent;
  box-shadow: none;
}
.pt-root .pt-tool.active,
.pt-root .pt-tool:active {
  border-color: #808080 #fff #fff #808080;
  background: repeating-conic-gradient(#fff 0 25%, #ece9d8 0 50%) 0 0 / 2px 2px;
  box-shadow: none;
}
.pt-root .pt-tool:focus { outline: none; }
.pt-tool svg { display: block; pointer-events: none; }

/* Tool options box */
.pt-options {
  margin-top: 4px;
  width: 42px;
  height: 66px;
  box-sizing: border-box;
  border: 1px solid;
  border-color: #808080 #fff #fff #808080;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pt-opt-col {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: space-evenly;
  width: 100%;
  height: 100%;
}
.pt-opt-grid {
  display: grid;
  grid-template-columns: repeat(3, 12px);
  grid-auto-rows: 12px;
  gap: 2px 1px;
}
.pt-opt {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
  min-height: 0;
}
.pt-opt i { display: block; background: #000; }
.pt-opt.on { background: #316ac5; }
.pt-opt.on i { background: #fff; }
.pt-opt-text { font-size: 10px; line-height: 1; }
.pt-opt-text.on { color: #fff; }
.pt-opt-sm canvas { display: block; }
.pt-opt-line i { max-width: 30px; }
.pt-opt .pt-spray {
  background: radial-gradient(circle, #000 1px, transparent 1.5px) 0 0 / 3px 3px;
  border-radius: 50%;
}
.pt-opt.on .pt-spray { background: radial-gradient(circle, #fff 1px, transparent 1.5px) 0 0 / 3px 3px; }
.pt-opt .pt-mode { width: 30px; height: 12px; box-sizing: border-box; background: transparent; }
.pt-opt .pt-mode-0 { border: 1px solid #000; }
.pt-opt .pt-mode-1 { border: 1px solid #000; background: #808080; }
.pt-opt .pt-mode-2 { background: #808080; }
.pt-opt.on .pt-mode-0, .pt-opt.on .pt-mode-1 { border-color: #fff; }
.pt-opt .pt-o-opaque, .pt-opt .pt-o-transp {
  display: block;
  width: 30px;
  height: 22px;
  box-sizing: border-box;
  border: 1px solid #000;
  background:
    radial-gradient(circle at 60% 55%, #c00 0 5px, transparent 5.5px),
    linear-gradient(135deg, #0a0 0 40%, transparent 40%),
    #ff0;
}
.pt-opt .pt-o-transp {
  background:
    radial-gradient(circle at 60% 55%, #c00 0 5px, transparent 5.5px),
    linear-gradient(135deg, #0a0 0 40%, transparent 40%),
    repeating-conic-gradient(#ddd 0 25%, #fff 0 50%) 0 0 / 6px 6px;
}
.pt-opt.on { outline: none; }

/* Workspace + canvas */
.pt-workspace {
  flex: 1;
  min-width: 0;
  overflow: auto;
  background: #808080;
  border: 1px solid;
  border-color: #808080 #fff #fff #808080;
  box-shadow: inset 1px 1px 0 #404040;
  position: relative;
}
.pt-wrap {
  position: relative;
  margin: 3px 8px 8px 3px;
}
.pt-canvas, .pt-overlay {
  position: absolute;
  left: 0;
  top: 0;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.pt-canvas { background: #fff; }
.pt-overlay { touch-action: none; }
.pt-handle {
  position: absolute;
  width: 3px;
  height: 3px;
  background: #316ac5;
  z-index: 2;
}
.pt-handle[data-h="e"] { left: 100%; top: calc(50% - 1px); cursor: ew-resize; }
.pt-handle[data-h="s"] { top: 100%; left: calc(50% - 1px); cursor: ns-resize; }
.pt-handle[data-h="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
/* Bigger invisible hit area around each handle. */
.pt-handle::before { content: ""; position: absolute; inset: -4px; }
.pt-resize-ghost {
  display: none;
  position: absolute;
  left: 0;
  top: 0;
  border: 1px dashed #000;
  box-sizing: border-box;
  pointer-events: none;
  z-index: 3;
}
.pt-textbox {
  position: absolute;
  z-index: 4;
  margin: 0;
  padding: 1px 2px;
  box-sizing: border-box;
  border: 1px dashed #000 !important;
  border-radius: 0;
  box-shadow: none !important;
  outline: none;
  resize: none;
  overflow: hidden;
  font-family: Arial, sans-serif;
  line-height: 15px;
  user-select: text;
}

/* Color box */
.pt-colorbox {
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 4px 3px 3px;
  flex-shrink: 0;
  border-top: 1px solid #fff;
}
.pt-current {
  position: relative;
  width: 30px;
  height: 31px;
  box-sizing: border-box;
  border: 1px solid;
  border-color: #808080 #fff #fff #808080;
  background: repeating-conic-gradient(#fff 0 25%, #ece9d8 0 50%) 0 0 / 2px 2px;
  margin-right: 2px;
}
.pt-fg, .pt-bg {
  position: absolute;
  width: 13px;
  height: 13px;
  box-sizing: border-box;
  border: 1px solid;
  border-color: #fff #808080 #808080 #fff;
  box-shadow: 0 0 0 1px #c0c0c0;
}
.pt-fg { left: 4px; top: 4px; z-index: 1; }
.pt-bg { left: 11px; top: 12px; }
.pt-palette {
  display: grid;
  grid-template-columns: repeat(14, 16px);
  grid-template-rows: 16px 16px;
}
.pt-swatch {
  box-sizing: border-box;
  border: 1px solid;
  border-color: #808080 #fff #fff #808080;
  box-shadow: inset 1px 1px 0 #404040;
  cursor: default;
}

/* Status bar */
.pt-status {
  display: flex;
  height: 20px;
  flex-shrink: 0;
  align-items: stretch;
  border-top: 1px solid #fff;
  cursor: default;
}
.pt-status > div:not(.np-grip) {
  line-height: 18px;
  white-space: nowrap;
  overflow: hidden;
  padding-left: 3px;
}
.pt-st-text { flex: 1; }
.pt-st-pos, .pt-st-size {
  width: 80px;
  border-left: 1px solid #aca899;
  box-shadow: -1px 0 0 #fff inset;
}
.pt-colorinput {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
  left: 0;
  bottom: 0;
}

.pt-root.pt-hide-toolbox .pt-toolbox,
.pt-root.pt-hide-colorbox .pt-colorbox,
.pt-root.pt-hide-statusbar .pt-status { display: none; }
