/* A compact attachment menu and a local, distraction-free sketchpad. */
.home-prompt-tools { display:flex; align-items:center; gap:6px; max-width:calc(100% - 64px); }
.home-model-picker { position:relative; min-width:0; }
.home-model-picker #modelSelector { max-width:min(190px,100%); }
.home-sketch-trigger { display:inline-flex; align-items:center; justify-content:center; flex:none; width:28px; height:28px; padding:4px; border:0; border-radius:8px; background:transparent; color:#8b849a; cursor:pointer; transition:background .15s,color .15s; }
.home-sketch-trigger svg { width:20px; height:20px; stroke:currentColor; stroke-width:1.8; stroke-linecap:round; stroke-linejoin:round; }
.home-sketch-trigger:hover { background:#eae5f2; color:#55486b; }
.home-sketch-trigger:focus-visible { outline:2px solid #8b7cf6; outline-offset:2px; }
.ac-add-menu { position:absolute; left:16px; bottom:59px; z-index:7; width:186px; padding:6px; background:#fff; border:1px solid #edebf1; border-radius:15px; box-shadow:0 10px 36px #29233316; }
.ac-add-menu button { width:100%; display:flex; align-items:center; gap:12px; padding:12px; border-radius:10px; color:#595264; text-align:left; font-size:13px; }
.ac-add-menu button:hover { background:#f5f2fa; }
.ac-add-menu button i { width:19px; text-align:center; color:#8b7cc1; }
#agentModal .ac-attachment .ac-sketch-thumbnail { padding:0; margin:0; width:48px; height:42px; border-radius:9px; flex:none; overflow:hidden; }
#agentModal .ac-sketch-thumbnail img { width:100%; height:100%; object-fit:contain; background:white; }
#agentModal .ac-attachment .ac-edit-sketch { margin-left:auto; width:auto; padding:4px 9px; height:30px; font-size:11px; color:#7a68a1; background:#eae5f2; border-radius:8px; }
#agentModal .ac-edit-sketch + button { margin-left:0; }
.ac-sketch-dialog, .ac-sketch-dialog * { box-sizing:border-box; }
.ac-sketch-dialog { position:fixed; inset:0; margin:auto; padding:0; width:min(1200px,calc(100vw - 56px),calc(100dvh - 72px)); height:min(1200px,calc(100vw - 56px),calc(100dvh - 72px)); max-width:none; max-height:none; border:1px solid #e5e5e5; border-radius:30px; background:#fff; color:#777; font-family:inherit; box-shadow:0 8px 20px #0000000c,0 2px 6px #0000000b; overflow:hidden; }
.ac-sketch-dialog::backdrop { background:#00000024; }
.ac-sketch-dialog [hidden] { display:none !important; }
.ac-sketch-dialog button { appearance:none; display:inline-flex; align-items:center; justify-content:center; flex:none; padding:0; margin:0; font:inherit; line-height:1; border:0; cursor:pointer; background:transparent; color:inherit; -webkit-tap-highlight-color:transparent; }
.ac-sketch-dialog button:disabled { opacity:.32; cursor:default; }
.ac-sketch-dialog button:focus-visible, .ac-sketch-dialog input:focus-visible { outline:2px solid #4386f5; outline-offset:4px; }
.ac-sketch-dialog svg { display:block; width:18px; height:18px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; pointer-events:none; }
.ac-sketch-dialog .ac-sketch-icon { width:28px; height:28px; border-radius:50%; }
.ac-sketch-dialog .ac-sketch-icon:hover:not(:disabled) { background:#f5f5f5; }
.ac-sketch-close { position:absolute; top:13px; left:12px; z-index:3; }
.ac-sketch-close svg { width:18px; height:18px; stroke-width:1.5; }
.ac-sketch-tools { position:absolute; z-index:3; top:10px; left:50%; transform:translateX(-50%); display:flex; gap:2px; align-items:center; padding:3px; background:#ffffffed; border:1px solid #eaeaea; box-shadow:0 1px 3px #00000013; border-radius:40px; }
.ac-sketch-tools button { width:30px; height:30px; border-radius:50%; color:#767676; }
.ac-sketch-tools button:hover { background:#f7f7f7; }
.ac-sketch-tools button[aria-pressed="true"] { color:#333; background:#f3f3f3; }
.ac-sketch-tools button[data-sketch-tool="pen"] svg { stroke-width:2; }
.ac-sketch-history { display:flex; position:absolute; z-index:3; top:13px; right:12px; gap:6px; }
.ac-sketch-history svg { width:18px; height:18px; }
.ac-sketch-stage { position:absolute; inset:0; display:flex; align-items:center; justify-content:center; overflow:hidden; background:white; }
#artSketchCanvas { display:block; flex:none; background:#fff; touch-action:none; cursor:crosshair; }
#artSketchCanvas[data-tool="select"] { cursor:default; }
#artSketchCanvas[data-tool="text"] { cursor:text; }
#artSketchCanvas[data-tool="eraser"] { cursor:cell; }
.ac-sketch-width { position:absolute; z-index:2; top:50%; left:12px; transform:translateY(-50%); width:24px; height:160px; display:flex; align-items:center; justify-content:center; }
.ac-sketch-dialog #artSketchWidth { appearance:none; -webkit-appearance:none; writing-mode:vertical-lr; direction:rtl; width:20px; height:160px; background:transparent !important; border:0 !important; box-shadow:none !important; outline:0; padding:0; margin:0; cursor:pointer; }
#artSketchWidth::-webkit-slider-runnable-track { width:2px; height:100%; background:#d3d3d3; border-radius:3px; }
#artSketchWidth::-webkit-slider-thumb { appearance:none; -webkit-appearance:none; width:16px; height:16px; margin-left:-7px; border:1px solid #d1d1d1; border-radius:50%; background:#fff; box-shadow:0 1px 3px #00000022; }
#artSketchWidth::-moz-range-track { width:2px; height:100%; background:#d3d3d3; }
#artSketchWidth::-moz-range-thumb { width:16px; height:16px; border:1px solid #d1d1d1; border-radius:50%; background:#fff; box-shadow:0 1px 3px #00000022; }
.ac-sketch-bottom { position:absolute; z-index:3; left:16px; right:16px; bottom:16px; display:grid; grid-template-columns:32px minmax(0,1fr) 32px; gap:16px; align-items:center; pointer-events:none; }
.ac-sketch-palette { grid-column:2; display:flex; align-items:center; justify-content:center; flex-wrap:wrap; justify-self:center; gap:8px; max-width:100%; min-width:0; padding:5px; pointer-events:auto; }
.ac-sketch-dialog .ac-sketch-palette button, .ac-sketch-custom { width:20px; height:20px; border-radius:50%; flex:none; box-shadow:0 1px 2px #00000018,inset 0 0 0 1px #00000014; }
.ac-sketch-dialog .ac-sketch-palette button { background:var(--ink); }
.ac-sketch-palette button[aria-pressed="true"] { outline:1.5px solid #296cd9; outline-offset:3px; }
.ac-sketch-custom { position:relative; display:block; cursor:pointer; overflow:hidden; background:conic-gradient(#fa3959,#fcba29,#c5ec24,#3ed078,#31b8e1,#7151f8,#d148dc,#fa3959); }
.ac-sketch-custom input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.ac-sketch-dialog .ac-sketch-save { grid-column:3; pointer-events:auto; width:32px; height:32px; border-radius:50%; background:#3b82f6; color:white; }
.ac-sketch-save svg { width:20px; height:20px; stroke-width:2; }
.ac-sketch-dialog .ac-sketch-save:hover:not(:disabled) { background:#2875ee; }
.ac-sketch-dialog .ac-sketch-save:disabled { opacity:.5; }
.ac-sketch-dialog[aria-busy="true"] .ac-sketch-save svg { opacity:.4; }
.ac-sketch-shapes { position:absolute; top:56px; left:50%; z-index:4; transform:translateX(-50%); display:flex; align-items:center; gap:4px; padding:6px; border:1px solid #eaeaea; border-radius:16px; background:#fff; box-shadow:0 5px 20px #0000000c; }
.ac-sketch-shapes button { width:30px; height:30px; border-radius:9px; }
.ac-sketch-shapes button:hover, .ac-sketch-shapes button[aria-pressed="true"] { background:#f3f3f3; }
.ac-sketch-shapes #artSketchClear { width:auto; white-space:nowrap; padding:0 12px; color:#999; font-size:11px; border-left:1px solid #eee; border-radius:0 9px 9px 0; }
#artSketchDialog #artSketchText { position:absolute; z-index:4; width:240px; min-height:0; padding:0; margin:0; resize:none; background:#ffffffee !important; border:0 !important; border-radius:0; box-shadow:none !important; outline:1px dashed #3b82f6 !important; outline-offset:4px; line-height:1.3; font-family:sans-serif; overflow:hidden; word-break:break-all; overflow-wrap:anywhere; }
.ac-sketch-text-selection { position:absolute; z-index:4; border:1px solid #3b82f6; cursor:move; touch-action:none; }
.ac-sketch-dialog .ac-sketch-text-handle { position:absolute; width:12px; height:12px; border:1.5px solid #3b82f6; border-radius:2px; background:white; touch-action:none; }
.ac-sketch-text-handle[data-text-corner="nw"] { top:-6px; left:-6px; cursor:nwse-resize; }
.ac-sketch-text-handle[data-text-corner="ne"] { top:-6px; right:-6px; cursor:nesw-resize; }
.ac-sketch-text-handle[data-text-corner="sw"] { bottom:-6px; left:-6px; cursor:nesw-resize; }
.ac-sketch-text-handle[data-text-corner="se"] { bottom:-6px; right:-6px; cursor:nwse-resize; }
.ac-sketch-text-options { position:absolute; z-index:5; top:56px; left:50%; transform:translateX(-50%); display:flex; align-items:center; gap:5px; padding:6px 10px; border:1px solid #eaeaea; border-radius:14px; background:#fff; box-shadow:0 3px 12px #0000000a; font-size:12px; color:#777; white-space:nowrap; }
.ac-sketch-text-options label { font-size:11px; margin-right:3px; }
.ac-sketch-text-options button { min-width:28px; height:30px; padding:0 6px; border-radius:7px; }
.ac-sketch-text-options button:hover { background:#f3f3f3; }
#artSketchDialog #artSketchFontSize { width:52px; height:30px; padding:2px 4px; margin:0; border:1px solid #e5e5e5 !important; border-radius:6px; background:#fafafa !important; color:#444 !important; box-shadow:none !important; text-align:center; font-size:12px; appearance:textfield; }
#artSketchFontSize::-webkit-inner-spin-button, #artSketchFontSize::-webkit-outer-spin-button { appearance:none; margin:0; }
.ac-sketch-error { position:absolute; z-index:4; bottom:84px; left:50%; transform:translateX(-50%); margin:0; padding:8px 14px; max-width:80%; border-radius:10px; font-size:12px; color:#a3475d; background:#fff2f5; }
@media(max-width:760px) {
 .ac-sketch-dialog { width:100%; height:100dvh; border:0; border-radius:0; }
 .ac-sketch-close { top:calc(13px + env(safe-area-inset-top)); left:10px; }
 .ac-sketch-tools { top:calc(10px + env(safe-area-inset-top)); }
 .ac-sketch-history { top:calc(13px + env(safe-area-inset-top)); right:10px; }
 .ac-sketch-width { left:9px; }
 .ac-sketch-bottom { left:14px; right:14px; bottom:calc(14px + env(safe-area-inset-bottom)); grid-template-columns:1fr 32px; gap:14px; }
 .ac-sketch-palette { grid-column:1 / -1; gap:6px; padding:5px; }
 .ac-sketch-dialog .ac-sketch-palette button, .ac-sketch-custom { width:18px; height:18px; }
 .ac-sketch-dialog .ac-sketch-save { grid-column:2; justify-self:end; }
 .ac-sketch-shapes, .ac-sketch-text-options { top:calc(56px + env(safe-area-inset-top)); }
 .ac-sketch-dialog .ac-sketch-text-handle { width:18px; height:18px; }
 .ac-sketch-text-handle[data-text-corner="nw"], .ac-sketch-text-handle[data-text-corner="ne"] { top:-9px; }
 .ac-sketch-text-handle[data-text-corner="sw"], .ac-sketch-text-handle[data-text-corner="se"] { bottom:-9px; }
 .ac-sketch-text-handle[data-text-corner="nw"], .ac-sketch-text-handle[data-text-corner="sw"] { left:-9px; }
 .ac-sketch-text-handle[data-text-corner="ne"], .ac-sketch-text-handle[data-text-corner="se"] { right:-9px; }
 .ac-sketch-error { bottom:130px; }
}
@media(max-width:360px) {
 .ac-sketch-tools { gap:1px; }
 .ac-sketch-tools button { width:28px; }
 .ac-sketch-bottom { gap:10px; }
 .ac-sketch-palette { gap:5px; }
}
