/* ---------- 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: calc((10px - var(--tlbx-hit, 44px)) / 2); }   /* a 44 px grab area (shared/input/touch.css) */
  .selbox .sh { width: 9px; height: 9px; }
  .selbox .sh::before { inset: calc((9px - var(--tlbx-hit, 44px)) / 2); }
}
@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; }
}
