/* Image Color Picker: image stage with loupe, side panel and palette. */
.cp-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 16px; align-items: start; }
@media (max-width: 760px) { .cp-layout { grid-template-columns: 1fr; } }
.preview.cp-stage { position: relative; display: block; padding: 0; min-height: 0; overflow: hidden; text-align: center; line-height: 0; }
.cp-stage #cp-canvas { display: inline-block; max-width: 100%; max-height: 65vh; width: auto; height: auto; cursor: crosshair; touch-action: none; outline: none; }
.cp-stage #cp-canvas:focus-visible { box-shadow: 0 0 0 3px var(--accent); }
.cp-loupe { position: absolute; width: 132px; height: 132px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); pointer-events: none; z-index: 2; }
.cp-side .input-group .btn { border-radius: var(--r); }
.cp-chip { width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line-strong); cursor: pointer; padding: 0; }
.cp-chip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cp-palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.cp-pal { display: grid; gap: 4px; padding: 8px; border-radius: var(--r); border: 1px solid var(--line); background: var(--glass-soft); color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.cp-pal:hover { border-color: var(--accent); }
.cp-pal-sw { display: block; height: 46px; border-radius: 10px; border: 1px solid var(--line); }
.cp-pal strong { font-family: var(--mono); font-size: 0.85rem; }
.cp-pal small { color: var(--muted); font-size: 0.78rem; }
/* Keep long file names from widening the panel on phones (grid tracks otherwise grow to min-content). */
#tool, #tool .stack, #tool .stack-sm, #tool .file-list { grid-template-columns: minmax(0, 1fr); }
#tool .hint, #tool .file-item .meta small { overflow-wrap: anywhere; }
