/* A labelled tool rail: common actions stay beside the canvas. */
.clean-board-tools{width:112px;max-height:calc(100dvh - 144px);align-items:stretch;gap:7px;padding:7px;border-radius:16px}
.clean-toolbar-heading{flex-shrink:0;padding:3px 0 1px;text-align:center;font-size:9px;font-weight:650;letter-spacing:1.7px;text-transform:uppercase;color:#94a3b8}
.clean-drawing-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px;min-height:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#cbd5e1 transparent}
.clean-drawing-grid .clean-tool-btn{position:relative;width:100%;height:43px;flex-direction:column;gap:4px;padding:4px 1px;border-radius:8px}
.clean-tool-label{font-size:9.5px;font-weight:500;line-height:1.15;letter-spacing:-.15px;white-space:nowrap}
.clean-drawing-grid .clean-tool-btn svg{width:18px;height:18px;flex-shrink:0}
.clean-symbol-icon{font-size:20px;font-family:Georgia,serif;line-height:18px}
.clean-drawing-grid [data-tool-options]::after{position:absolute;top:3px;right:3px;content:'⌄';font-size:9px;line-height:1;color:#94a3b8}
.clean-drawing-grid .active[data-tool-options]::after{color:#c7d2fe}
.clean-toolbar-footer{display:flex;flex-direction:column;flex-shrink:0;gap:6px;border-top:1px solid #eef2f6;padding-top:7px}
.clean-toolbar-options,.clean-toolbar-history{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:3px}
.clean-toolbar-options .clean-tool-btn{width:100%;height:41px;flex-direction:column;gap:5px;padding:3px 0}
.clean-toolbar-options svg{width:17px;height:17px}
.clean-toolbar-options .clean-tool-label{font-size:9px}
.clean-toolbar-history .clean-tool-btn{width:100%;height:29px;gap:4px}
.clean-toolbar-history .clean-tool-label{font-size:9px}
.clean-toolbar-history svg{width:15px;height:15px}
html[lang="hi"] .clean-toolbar-history .clean-tool-label{display:none}
.clean-toolbar-actions{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:2px;border-top:1px solid #eef2f6;padding-top:5px}
.clean-toolbar-actions .clean-tool-btn{width:100%;height:36px;flex-direction:column;gap:4px;border-radius:7px}
.clean-toolbar-actions svg{width:16px;height:16px}
.clean-toolbar-actions .clean-tool-label{font-size:8.5px;letter-spacing:-.2px}
.clean-toolbar-options .clean-ink-swatch{width:17px;height:17px;border-width:2px;box-shadow:none}
.clean-view-controls{align-items:center;gap:7px}
.clean-language-quick{display:flex;align-items:center;justify-content:center;min-height:34px;padding:7px 10px;border:1px solid #e0e7ff;border-radius:10px;background:#f5f6ff;color:#4338ca;font-size:12px;line-height:1.3;text-decoration:none}
.clean-language-quick:hover{background:#eef2ff}
body.clean-board #subToolPanel{left:138px;top:64px;max-height:calc(100dvh - 82px)}
#subToolPanel .sub-btn.active{background:#4f46e5;color:#fff;border-color:#4f46e5}
.clean-ink-panel{left:138px;max-width:calc(100vw - 150px)}
html.dark .clean-toolbar-footer,html.dark .clean-toolbar-actions{border-color:#334155}
html.dark .clean-language-quick{background:#1e1b4b;border-color:#3730a3;color:#c7d2fe}
@media(min-width:640px) and (max-height:720px){
  .clean-board-tools{gap:4px;padding:5px}
  .clean-drawing-grid{gap:2px}
  .clean-drawing-grid .clean-tool-btn{height:37px;gap:2px}
  .clean-tool-label{font-size:9px}
  .clean-toolbar-options .clean-tool-btn{height:34px;gap:3px}
  .clean-toolbar-footer{gap:3px;padding-top:4px}
  .clean-toolbar-actions{padding-top:3px}
  .clean-toolbar-actions .clean-tool-btn{height:33px}
}
@media(max-width:639px){
  .clean-board-tools{width:calc(100vw - 20px);max-width:430px;max-height:none;flex-direction:column;align-items:stretch;gap:5px;padding:6px;border-radius:15px}
  .clean-toolbar-heading{display:none}
  .clean-drawing-grid{display:flex;gap:4px;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity;padding-bottom:4px;scrollbar-width:thin;max-width:100%}
  .clean-drawing-grid .clean-tool-btn{width:45px;min-width:45px;height:42px;gap:3px;scroll-snap-align:center}
  .clean-toolbar-footer{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:3px;padding-top:5px}
  .clean-toolbar-options,.clean-toolbar-history,.clean-toolbar-actions{display:contents}
  .clean-toolbar-footer .clean-tool-btn{width:40px;height:35px;min-width:30px;flex-direction:column;gap:3px;padding:2px 0}
  .clean-toolbar-footer .clean-tool-label{font-size:8.5px}
  .clean-toolbar-footer .clean-tool-btn svg{width:16px;height:16px}
  .clean-toolbar-history .clean-tool-btn{width:30px}
  .clean-toolbar-history .clean-tool-label{display:none}
  .clean-toolbar-footer .clean-ink-swatch{width:16px;height:16px}
  .clean-view-controls{gap:5px;top:12px;right:12px}
  .clean-language-quick{font-size:11px;min-height:32px;padding:7px 8px}
  .clean-view-controls button{padding:8px 9px}
  .studio-board-shortcut{max-width:calc(100vw - 187px)}
  .studio-canvas-nav{bottom:calc(142px + env(safe-area-inset-bottom))}
  .clean-ink-panel{left:50%;bottom:calc(190px + env(safe-area-inset-bottom));max-width:calc(100vw - 24px)}
  body.clean-board #subToolPanel{left:12px;right:12px;top:auto;bottom:calc(190px + env(safe-area-inset-bottom));max-height:calc(100dvh - 254px)}
}
