/* Slop Paint — slopographic.com */
:root {
  --face: #c0c0c0;
  --hi: #ffffff;
  --lt: #dfdfdf;
  --sh: #808080;
  --dk: #0a0a0a;
  --hl: #000080;
  --hl-text: #ffffff;
  --slop: #d4ff3a;
  --slop2: #9fcc00;
  --desk: #008080;
  --ui: 11px Tahoma, "MS Sans Serif", "Microsoft Sans Serif", "Segoe UI", Geneva, Verdana, "DejaVu Sans", sans-serif;
  --raised: inset -1px -1px var(--dk), inset 1px 1px var(--hi), inset -2px -2px var(--sh), inset 2px 2px var(--lt);
  --pressed: inset -1px -1px var(--hi), inset 1px 1px var(--dk), inset -2px -2px var(--lt), inset 2px 2px var(--sh);
  --field: inset -1px -1px var(--hi), inset 1px 1px var(--sh), inset -2px -2px var(--lt), inset 2px 2px var(--dk);
  --thin-in: inset 1px 1px var(--sh), inset -1px -1px var(--hi);
  --thin-out: inset -1px -1px var(--sh), inset 1px 1px var(--hi);
  --window: inset -1px -1px var(--dk), inset 1px 1px var(--lt), inset -2px -2px var(--sh), inset 2px 2px var(--hi);
  --dither: repeating-conic-gradient(var(--hi) 0 25%, var(--face) 0 50%) 0 0 / 2px 2px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--desk);
  font: var(--ui);
  color: #000;
  -webkit-font-smoothing: none;
  -webkit-text-size-adjust: 100%;
}
body {
  position: fixed;
  inset: 0;
  overscroll-behavior: none;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}
button, input, select, textarea { font: var(--ui); color: #000; }
button { cursor: default; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }

/* ---------- desktop ---------- */
.desktop { position: fixed; inset: 0 0 30px 0; }
.dicon {
  position: absolute; left: 10px; width: 72px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: none; border: 0; padding: 2px; color: #fff; text-decoration: none; text-align: center;
}
.dicon span { padding: 1px 2px; }
.desktop:has(> .app:not([hidden])) .dicon { visibility: hidden; }
.dicon:focus-visible span, .dicon:active span { background: var(--hl); outline: 1px dotted #fff; }

/* ---------- window ---------- */
.win {
  background: var(--face);
  padding: 3px;
  box-shadow: var(--window);
}
.app {
  position: absolute;
  inset: 10px 10px 10px 10px;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
@media (min-width: 1200px) { .app { inset: 18px 22px 16px 22px; } }
.app.max { inset: 0; }
.titlebar {
  height: 18px;
  flex: none;
  display: flex;
  align-items: center;
  gap: 3px;
  padding: 0 2px 0 2px;
  background: linear-gradient(90deg, var(--slop), var(--slop2));
  color: #0a0a0a;
  font-weight: bold;
  touch-action: none;
}
.app.inactive > .titlebar { background: linear-gradient(90deg, #808080, #b5b5b5); color: #d4d0c8; }
.titlebar .ticon { flex: none; }
.titlebar .ttl { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .1px; }
.tbtn {
  width: 16px; height: 14px; flex: none;
  border: 0; padding: 0;
  background: var(--face);
  box-shadow: var(--raised);
  display: grid; place-items: center;
}
.tbtn svg { fill: #000; display: block; }
.tbtn:active { box-shadow: var(--pressed); }
.tbtn:active svg { transform: translate(1px, 1px); }
.tbtn.close { margin-left: 2px; }

/* ---------- menus ---------- */
.menubar { display: flex; flex: none; padding: 1px 0 1px; position: relative; }
.mb-item {
  border: 0; background: none; padding: 2px 6px 3px; line-height: 14px;
}
.mb-item.open { box-shadow: var(--thin-in); padding: 3px 5px 2px 7px; }
.mb-item:focus-visible { outline: 1px dotted #000; outline-offset: -2px; }
.menu {
  position: fixed;
  z-index: 300;
  min-width: 170px;
  padding: 3px;
  background: var(--face);
  box-shadow: var(--window), 2px 2px 0 rgba(0,0,0,.25);
  display: flex; flex-direction: column;
}
.mi {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  align-items: center;
  gap: 2px;
  border: 0; background: none; text-align: left;
  padding: 3px 14px 3px 4px; line-height: 13px;
  white-space: nowrap;
}
.mi .k { padding-left: 24px; }
.mi .chk { font-size: 11px; text-align: center; }
.mi:hover, .mi:focus { background: var(--hl); color: var(--hl-text); outline: none; }
.mi[aria-disabled="true"] { color: var(--sh); text-shadow: 1px 1px var(--hi); }
.mi[aria-disabled="true"]:hover, .mi[aria-disabled="true"]:focus { color: var(--sh); text-shadow: none; }
.mi.slopify { font-weight: bold; }
.mi.slopify .lbl::after { content: " \2728"; }
.sep { height: 2px; margin: 3px 1px; border-top: 1px solid var(--sh); border-bottom: 1px solid var(--hi); flex: none; }

/* ---------- body ---------- */
.body { flex: 1; display: flex; min-height: 0; position: relative; padding-top: 1px; }
.toolbox {
  width: 58px; flex: none;
  display: flex; flex-direction: column; align-items: center;
  padding: 3px 3px 0 2px; gap: 5px;
  overflow-y: auto; overflow-x: hidden;
  scrollbar-width: none;
}
.toolbox::-webkit-scrollbar { display: none; }
.tools { display: grid; grid-template-columns: repeat(2, 25px); grid-auto-rows: 25px; }
.tool {
  width: 25px; height: 25px; border: 0; padding: 0;
  background: var(--face); box-shadow: var(--raised);
  display: grid; place-items: center;
}
.tool svg { width: 16px; height: 16px; display: block; pointer-events: none; }
.tool[aria-pressed="true"] { box-shadow: var(--pressed); background: var(--dither); }
.tool[aria-pressed="true"] svg { transform: translate(1px, 1px); }
.tool:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }
.tool-sep {
  grid-column: 1 / -1; height: 9px; position: relative;
}
.tool-sep::before {
  content: ""; position: absolute; left: 1px; right: 1px; top: 3px; height: 2px;
  border-top: 1px solid var(--sh); border-bottom: 1px solid var(--hi);
}
.optbox {
  width: 46px; min-height: 68px; flex: none;
  box-shadow: var(--thin-in);
  padding: 4px 2px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.optsec { display: grid; grid-template-columns: repeat(var(--cols, 1), auto); gap: 1px; justify-content: center; }
.optsec + .optsec { padding-top: 4px; border-top: 1px solid var(--sh); box-shadow: 0 -1px 0 var(--hi) inset; }
.opt {
  border: 0; background: transparent; padding: 1px;
  display: grid; place-items: center;
  min-width: 13px; min-height: 13px; line-height: 1;
  font-size: 10px;
}
.opt canvas { display: block; image-rendering: pixelated; }
.opt.txt { width: 36px; padding: 2px 0; font-size: 11px; }
.opt.emo { font-size: 15px; width: 20px; height: 20px; padding: 0; font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }
.opt.sel { background: var(--hl); color: var(--hl-text); }
.opt.sel canvas.inv { filter: invert(1); }
.opt:focus-visible { outline: 1px dotted #000; outline-offset: 0; }

/* ---------- workspace ---------- */
.ws-frame { flex: 1; min-width: 0; min-height: 0; padding: 2px; box-shadow: var(--field); display: flex; }
.workspace {
  flex: 1; min-width: 0; min-height: 0;
  overflow: auto;
  background: var(--sh);
  position: relative;
}
.stage { position: relative; }
.wrap {
  position: absolute; left: 3px; top: 3px;
  touch-action: none;
  background: #fff;
}
.wrap canvas {
  position: absolute; left: 0; top: 0;
  image-rendering: pixelated;
  display: block;
}
#overlay { pointer-events: none; }
.grid {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(128,128,128,.75) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(128,128,128,.75) 1px, transparent 1px);
}
.selbox {
  position: absolute; pointer-events: none;
  border: 1px dashed #000;
  outline: 1px solid rgba(255,255,255,.55);
  outline-offset: -2px;
}
.selbox .sh {
  position: absolute; width: 5px; height: 5px; background: var(--hl);
  pointer-events: auto; display: none; touch-action: none;
}
.selbox.handles .sh { display: block; }
.selbox .sh::before { content: ""; position: absolute; inset: -5px; }
.sh[data-dir="nw"] { left: -3px; top: -3px; cursor: nwse-resize; }
.sh[data-dir="n"] { left: calc(50% - 3px); top: -3px; cursor: ns-resize; }
.sh[data-dir="ne"] { right: -3px; top: -3px; cursor: nesw-resize; }
.sh[data-dir="w"] { left: -3px; top: calc(50% - 3px); cursor: ew-resize; }
.sh[data-dir="e"] { right: -3px; top: calc(50% - 3px); cursor: ew-resize; }
.sh[data-dir="sw"] { left: -3px; bottom: -3px; cursor: nesw-resize; }
.sh[data-dir="s"] { left: calc(50% - 3px); bottom: -3px; cursor: ns-resize; }
.sh[data-dir="se"] { right: -3px; bottom: -3px; cursor: nwse-resize; }
.ghost { position: absolute; left: 0; top: 0; border: 1px dashed #000; pointer-events: none; outline: 1px solid rgba(255,255,255,.5); outline-offset: -2px; }
.hdl {
  position: absolute; width: 4px; height: 4px; background: var(--hl);
  touch-action: none;
}
.hdl::before { content: ""; position: absolute; inset: -7px; }
.hdl.e { left: 100%; top: calc(50% - 2px); cursor: ew-resize; }
.hdl.s { top: 100%; left: calc(50% - 2px); cursor: ns-resize; }
.hdl.se { left: 100%; top: 100%; cursor: nwse-resize; }
.textbox { position: absolute; outline: 1px dashed #000; }
.textbox textarea {
  display: block; width: 100%; height: 100%;
  border: 0; margin: 0; padding: 0;
  resize: none; overflow: hidden;
  background: transparent; outline: none;
  white-space: pre-wrap; overflow-wrap: break-word;
  user-select: text; -webkit-user-select: text;
  font-kerning: normal;
}

/* ---------- fonts toolbar ---------- */
.fontbar { position: absolute; top: 6px; right: 12px; z-index: 40; padding: 3px; }
.titlebar.mini { height: 15px; font-size: 11px; padding-left: 4px; }
.titlebar.mini .tbtn { width: 13px; height: 11px; }
.titlebar.mini .tbtn svg { width: 6px; height: 6px; }
.fb-row { display: flex; gap: 3px; padding: 4px 2px 2px; align-items: center; }
#fFamily { width: 150px; }
#fSize { width: 52px; }
.fb-t { width: 23px; height: 22px; border: 0; padding: 0; background: var(--face); box-shadow: var(--raised); font-size: 13px; font-family: "Times New Roman", serif; }
.fb-t[aria-pressed="true"] { box-shadow: var(--pressed); background: var(--dither); }

/* ---------- form controls ---------- */
select, input[type="text"], input[type="number"] {
  height: 21px; border: 0; border-radius: 0;
  background-color: #fff; box-shadow: var(--field);
  padding: 2px 4px;
}
select {
  appearance: none; -webkit-appearance: none;
  padding-right: 20px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='17' shape-rendering='crispEdges'%3E%3Crect width='16' height='17' fill='%23c0c0c0'/%3E%3Cpath d='M0 0h15v1H1v15H0z' fill='%23dfdfdf'/%3E%3Cpath d='M1 1h13v1H2v13H1z' fill='%23fff'/%3E%3Cpath d='M15 0h1v17H0v-1h15z' fill='%230a0a0a'/%3E%3Cpath d='M14 1h1v15H1v-1h13z' fill='%23808080'/%3E%3Cpath d='M4 7h7v1H4zM5 8h5v1H5zM6 9h3v1H6zM7 10h1v1H7z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 2px center;
}
input[type="number"] { width: 64px; }
input[type="number"]::-webkit-inner-spin-button { opacity: 1; }
input[type="radio"], input[type="checkbox"] {
  appearance: none; -webkit-appearance: none;
  width: 12px; height: 12px; margin: 0 5px 0 0; flex: none;
  background: #fff; box-shadow: var(--field); vertical-align: -2px;
}
input[type="radio"] { border-radius: 50%; }
input[type="radio"]:checked { background: radial-gradient(#000 0 2px, #fff 2.5px); }
input[type="checkbox"]:checked { background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12'%3E%3Cpath d='M3 5l2 2 4-4v2l-4 4-2-2z'/%3E%3C/svg%3E") center no-repeat; }
input:disabled + span, label.disabled { color: var(--sh); text-shadow: 1px 1px var(--hi); }

/* ---------- color box ---------- */
.colorbox {
  flex: none; display: flex; align-items: center; gap: 4px;
  padding: 5px 3px 3px 2px;
  overflow-x: auto; overflow-y: hidden; scrollbar-width: thin;
}
.curcolors {
  width: 32px; height: 32px; flex: none; position: relative;
  border: 0; padding: 0;
  background: var(--dither);
  box-shadow: var(--thin-in);
}
.cc {
  position: absolute; width: 15px; height: 15px;
  box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--hi), inset 2px 2px var(--dk), inset -2px -2px var(--lt);
}
.cc.fg { left: 4px; top: 4px; z-index: 1; }
.cc.bg { left: 12px; top: 12px; }
.palette { display: grid; grid-template-columns: repeat(15, 16px); grid-auto-rows: 16px; flex: none; }
.sw {
  width: 16px; height: 16px; border: 0; padding: 0;
  box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--hi), inset 2px 2px var(--dk), inset -2px -2px var(--lt);
}
.sw:focus-visible { outline: 1px dotted #000; outline-offset: -1px; }

/* ---------- status bar ---------- */
.statusbar { flex: none; display: flex; gap: 2px; padding-top: 2px; height: 22px; position: relative; }
.sb { box-shadow: var(--thin-in); padding: 3px 4px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb.msg { flex: 1; min-width: 0; }
.sb.pos, .sb.size, .sb.cv { width: 92px; flex: none; }
.sb.cv { margin-right: 14px; }
.grip {
  position: absolute; right: 0; bottom: 0; width: 13px; height: 13px;
  background:
    linear-gradient(135deg, transparent 0 45%, var(--hi) 45% 52%, var(--sh) 52% 66%, transparent 66% 70%, var(--hi) 70% 77%, var(--sh) 77% 91%, transparent 91%);
}

/* ---------- toast ---------- */
.toast {
  position: absolute; left: 50%; top: 40%; z-index: 60; pointer-events: none;
  transform: translate(-50%, -50%) scale(.6); opacity: 0;
  font: 900 clamp(32px, 9vw, 88px)/1 Impact, "Arial Black", "DejaVu Sans", sans-serif;
  letter-spacing: -1px; color: var(--slop);
  -webkit-text-stroke: 2px #0a0a0a;
  text-shadow: 4px 4px 0 #0a0a0a;
  white-space: nowrap;
}
.toast.show { animation: toast 1.4s cubic-bezier(.2, 1.4, .4, 1) forwards; }
@keyframes toast {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.4) rotate(-6deg); }
  20% { opacity: 1; transform: translate(-50%, -50%) scale(1.05) rotate(-3deg); }
  75% { opacity: 1; transform: translate(-50%, -50%) scale(1) rotate(-3deg); }
  100% { opacity: 0; transform: translate(-50%, -60%) scale(1) rotate(-3deg); }
}

/* ---------- dialogs ---------- */
.modal-back { position: fixed; inset: 0; z-index: 400; }
.dialog {
  position: absolute; display: flex; flex-direction: column;
  width: min(var(--w, 320px), calc(100vw - 12px));
  max-height: calc(100dvh - 12px);
}
.dialog .titlebar { cursor: default; }
.dlg-body { padding: 12px 11px 6px; overflow: auto; }
.btnrow { display: flex; justify-content: flex-end; gap: 6px; padding: 8px 11px 10px; flex-wrap: wrap; }
.btnrow.center { justify-content: center; }
.btn {
  min-width: 75px; height: 23px; padding: 0 10px;
  border: 0; background: var(--face); box-shadow: var(--raised);
}
.btn.default { box-shadow: 0 0 0 1px var(--dk), var(--raised); }
.btn:active { box-shadow: var(--pressed); padding: 1px 9px 0 11px; }
.btn.default:active { box-shadow: 0 0 0 1px var(--dk), var(--pressed); }
.btn:disabled { color: var(--sh); text-shadow: 1px 1px var(--hi); }
.btn:focus-visible { outline: 1px dotted #000; outline-offset: -4px; }
fieldset { border: 0; margin: 0 0 10px; padding: 12px 10px 8px; position: relative; box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--hi), 1px 1px 0 var(--hi); }
legend { padding: 0 3px; position: absolute; top: -7px; left: 7px; background: var(--face); }
.row { display: flex; align-items: center; gap: 8px; margin: 4px 0; flex-wrap: wrap; }
.row label { display: inline-flex; align-items: center; }
.field-row { display: grid; grid-template-columns: auto auto; gap: 6px 10px; align-items: center; justify-content: start; }
.msg-wrap { display: flex; gap: 14px; align-items: flex-start; padding: 4px 4px 2px; }
.msg-wrap svg { flex: none; }
.msg-wrap p { margin: 6px 0 0; white-space: pre-line; line-height: 1.4; }
.about { display: flex; gap: 14px; }
.about .logo { flex: none; }
.about p { margin: 0 0 6px; line-height: 1.35; }
.about hr { border: 0; border-top: 1px solid var(--sh); border-bottom: 1px solid var(--hi); margin: 8px 0; }
.about a { color: #0000ee; }
.about .big { font-size: 13px; font-weight: bold; }
.helplist { margin: 0; padding-left: 16px; line-height: 1.45; max-height: 50vh; overflow: auto; background: #fff; box-shadow: var(--field); padding: 8px 10px 8px 24px; user-select: text; -webkit-user-select: text; }
.helplist b { font-weight: bold; }
.indent { padding-left: 18px; }

/* edit colors */
.ec { display: flex; gap: 12px; flex-wrap: wrap; }
.ec-left { width: 214px; }
.ec-grid { display: grid; grid-template-columns: repeat(8, 24px); gap: 3px 2px; margin: 4px 0 10px; }
.ec-grid button {
  width: 24px; height: 18px; border: 0; padding: 0;
  box-shadow: inset 1px 1px var(--sh), inset -1px -1px var(--hi), inset 2px 2px var(--dk), inset -2px -2px var(--lt);
}
.ec-grid button.cur { outline: 1px solid #000; outline-offset: 1px; }
.ec-right { display: flex; flex-direction: column; gap: 8px; }
.ec-spec-row { display: flex; gap: 6px; align-items: stretch; }
.ec-spec, .ec-lum { position: relative; box-shadow: var(--field); padding: 2px; touch-action: none; }
.ec-spec canvas, .ec-lum canvas { display: block; }
.ec-cross { position: absolute; width: 19px; height: 19px; margin: -8px 0 0 -8px; pointer-events: none;
  background: linear-gradient(#000, #000) 9px 0 / 1px 7px no-repeat, linear-gradient(#000, #000) 9px 12px / 1px 7px no-repeat,
              linear-gradient(#000, #000) 0 9px / 7px 1px no-repeat, linear-gradient(#000, #000) 12px 9px / 7px 1px no-repeat; }
.ec-arrow { position: absolute; left: calc(100% + 2px); width: 0; height: 0; margin-top: -4px; border: 4px solid transparent; border-right: 6px solid #000; border-left: 0; }
.ec-lumwrap { position: relative; padding-right: 9px; }
.ec-bottom { display: flex; gap: 8px; align-items: flex-start; }
.ec-prev { width: 60px; height: 42px; box-shadow: var(--field); padding: 2px; display: flex; }
.ec-prev span { flex: 1; }
.ec-fields { display: grid; grid-template-columns: auto 44px auto 44px; gap: 3px 4px; align-items: center; }
.ec-fields input { width: 44px; height: 20px; padding: 2px 3px; }
.ec-fields label { text-align: right; }
.ec-hex { display: flex; gap: 6px; align-items: center; }
.ec-hex input { width: 80px; }

/* view bitmap */
.viewbmp { position: fixed; inset: 0; z-index: 500; background: #000; display: grid; place-items: center; overflow: auto; }
.viewbmp img { image-rendering: pixelated; max-width: none; }

/* ---------- taskbar ---------- */
.taskbar {
  position: fixed; left: 0; right: 0; bottom: 0; height: 30px; z-index: 200;
  background: var(--face);
  box-shadow: inset 0 1px var(--lt), inset 0 2px var(--hi);
  display: flex; align-items: center; gap: 4px;
  padding: 4px 2px 2px;
}
.start, .task {
  height: 22px; border: 0; background: var(--face); box-shadow: var(--raised);
  display: flex; align-items: center; gap: 4px; padding: 0 6px 0 4px;
}
.start { font-weight: bold; flex: none; }
.start[aria-expanded="true"], .task.active { box-shadow: var(--pressed); }
.task.active { background: var(--dither); font-weight: bold; }
.task { flex: 0 1 180px; min-width: 0; text-align: left; }
.task span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tray {
  margin-left: auto; height: 22px; flex: none;
  box-shadow: var(--thin-in);
  display: flex; align-items: center; gap: 10px; padding: 0 8px;
}
.home-link { color: #000; text-decoration: none; }
.home-link:hover, .home-link:focus-visible { text-decoration: underline; }
.startmenu {
  position: fixed; left: 2px; bottom: 28px; z-index: 250;
  display: flex; min-width: 230px;
}
.startmenu .banner {
  width: 24px; flex: none;
  background: linear-gradient(0deg, #4d6600, var(--slop2));
  color: var(--slop);
  writing-mode: vertical-rl; transform: rotate(180deg);
  font: 18px/24px "Arial Black", Arial, sans-serif; letter-spacing: 1px;
  padding: 6px 0;
}
.startmenu .banner b { color: #fff; }
.sm-items { flex: 1; display: flex; flex-direction: column; padding: 1px; }
.sm-item {
  display: flex; align-items: center; gap: 10px;
  border: 0; background: none; padding: 6px 10px 6px 6px;
  color: #000; text-decoration: none; text-align: left; font: var(--ui);
}
.sm-item:hover, .sm-item:focus { background: var(--hl); color: #fff; outline: none; }

/* ---------- Win98 scrollbars ---------- */
.workspace::-webkit-scrollbar, .dlg-body::-webkit-scrollbar, .helplist::-webkit-scrollbar { width: 16px; height: 16px; }
.workspace::-webkit-scrollbar-track, .dlg-body::-webkit-scrollbar-track, .helplist::-webkit-scrollbar-track { background: var(--dither); }
.workspace::-webkit-scrollbar-thumb, .dlg-body::-webkit-scrollbar-thumb, .helplist::-webkit-scrollbar-thumb { background: var(--face); box-shadow: var(--raised); }
.workspace::-webkit-scrollbar-corner { background: var(--face); }
.workspace::-webkit-scrollbar-button:single-button { display: block; width: 16px; height: 16px; background-color: var(--face); box-shadow: var(--raised); background-repeat: no-repeat; background-position: center; }
.workspace::-webkit-scrollbar-button:single-button:vertical:decrement { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='4'%3E%3Cpath d='M3 0h1v1h1v1h1v1h1v1H0V3h1V2h1V1h1z'/%3E%3C/svg%3E"); }
.workspace::-webkit-scrollbar-button:single-button:vertical:increment { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='7' height='4'%3E%3Cpath d='M0 0h7v1H6v1H5v1H4v1H3V3H2V2H1V1H0z'/%3E%3C/svg%3E"); }
.workspace::-webkit-scrollbar-button:single-button:horizontal:decrement { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='7'%3E%3Cpath d='M3 0h1v7H3V6H2V5H1V4H0V3h1V2h1V1h1z'/%3E%3C/svg%3E"); }
.workspace::-webkit-scrollbar-button:single-button:horizontal:increment { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='7'%3E%3Cpath d='M0 0h1v1h1v1h1v1h1v1H3v1H2v1H1v1H0z'/%3E%3C/svg%3E"); }
.workspace::-webkit-scrollbar-button:single-button:active { box-shadow: var(--thin-in); }

/* ---------- touch / small screens ---------- */
@media (pointer: coarse) {
  .hdl { width: 10px; height: 10px; }
  .hdl.e { top: calc(50% - 5px); }
  .hdl.s { left: calc(50% - 5px); }
  .hdl::before { inset: -10px; }
  .selbox .sh { width: 9px; height: 9px; }
  .selbox .sh::before { inset: -8px; }
}
@media (max-width: 700px) {
  .app { inset: 0 !important; padding: 2px; }
  #btnMax, .dicon, .grip { display: none; }
  .titlebar { height: 22px; }
  .menubar { padding: 0; overflow-x: auto; scrollbar-width: none; }
  .mb-item { padding: 5px 9px; font-size: 12px; }
  .mb-item.open { padding: 6px 8px 4px 10px; }
  .mi { padding: 7px 14px 7px 4px; font-size: 12px; }
  .body { flex-direction: column; }
  .toolbox {
    width: auto; flex-direction: row; align-items: center;
    overflow-x: auto; overflow-y: hidden; padding: 2px 2px 3px; gap: 6px;
    scrollbar-width: none;
  }
  .tools { grid-template-columns: none; grid-template-rows: repeat(2, 32px); grid-auto-flow: column; grid-auto-columns: 32px; }
  .tool { width: 32px; height: 32px; }
  .tool svg { width: 20px; height: 20px; }
  .tool-sep { grid-column: auto; grid-row: 1 / -1; width: 8px; height: auto; }
  .tool-sep::before { left: 3px; top: 2px; bottom: 2px; right: auto; width: 2px; height: auto; border: 0; border-left: 1px solid var(--sh); border-right: 1px solid var(--hi); }
  .optbox { width: auto; min-height: 66px; height: 66px; flex-direction: row; padding: 2px 4px; gap: 6px; }
  .optsec { grid-template-columns: none !important; grid-template-rows: repeat(2, auto); grid-auto-flow: column; align-content: center; }
  .optsec + .optsec { border-top: 0; box-shadow: none; padding-top: 0; padding-left: 6px; border-left: 1px solid var(--sh); }
  .opt { min-width: 22px; min-height: 22px; }
  .opt.txt { width: 30px; }
  .opt.emo { width: 26px; height: 26px; font-size: 18px; }
  .palette { grid-template-columns: repeat(15, 22px); grid-auto-rows: 22px; }
  .sw { width: 22px; height: 22px; }
  .curcolors { width: 40px; height: 44px; }
  .cc { width: 20px; height: 20px; }
  .cc.bg { left: 15px; top: 19px; }
  .sb.msg { display: none; }
  .sb.pos, .sb.size, .sb.cv { flex: 1; width: auto; }
  .sb.cv { margin-right: 0; }
  .fontbar { left: 4px; right: 4px; top: 74px; }
  .fb-row { flex-wrap: wrap; }
  #fFamily { flex: 1; min-width: 110px; }
  .task { flex: 1 1 auto; }
  .home-link { font-weight: bold; }
  #clock { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .toast.show { animation-duration: .01s; }
}
