#integratedColorPanel{margin:0;display:block;background:#2e2e2e;font-family:Arial;}
#integratedColorPanel .picker{
  background:#3a3a3a;
  padding:15px;
  border-radius:6px;
  box-shadow:0 0 10px rgba(0,0,0,.5);
  width:265px;max-width:calc(100% - 30px);max-width:calc(100% - 30px);
  color:white; 
  user-select: none;      /* impede seleção de texto */
  -webkit-user-select: none; /* para Safari/Chrome */
  -moz-user-select: none;    /* para Firefox */
  -ms-user-select: none;     /* para IE/Edge */
}
#integratedColorPanel .tabs{display:flex;margin-bottom:10px;}
#integratedColorPanel .tab{flex:1;padding:6px;text-align:center;background:#444;cursor:pointer;border-radius:4px 4px 0 0;}
#integratedColorPanel .tab.active{background:#666;}
#integratedColorPanel .tab-content{display:none;}
#integratedColorPanel .tab-content.active{display:block;}
#integratedColorPanel .row{display:flex;margin-bottom:10px;}
#integratedColorPanel #sv{cursor:crosshair;border:1px solid black;background:transparent;}
#integratedColorPanel #wheelCanvas{cursor:crosshair;background:transparent;}
#integratedColorPanel #hue, #integratedColorPanel #alpha, #integratedColorPanel #lightness, #integratedColorPanel #alphaWheel{cursor:pointer;border:1px solid black;background:transparent;}
#integratedColorPanel .cursor{position:absolute;width:12px;height:12px;border:2px solid white;border-radius:50%;pointer-events:none;transform:translate(-50%,-50%);}
#integratedColorPanel .slider-cursor{position:absolute;width:0;height:0;pointer-events:none;}
#integratedColorPanel .left-pointer{border-top:4px solid transparent;border-bottom:4px solid transparent;border-left:4px solid white;left:-4px;transform:translateY(-50%);}
#integratedColorPanel .right-pointer{border-top:4px solid transparent;border-bottom:4px solid transparent;border-right:4px solid white;right:-4px;transform:translateY(-50%);}
#integratedColorPanel .preview{height:40px;border:1px solid black;margin-top:10px;cursor:pointer;transition:0.2s;}
#integratedColorPanel .fields input{width:calc(100% - 9px);margin-top:4px;padding:4px;border:none;background:transparent;color:#989898;text-transform:uppercase;outline:none;border-radius: 3px;}
#integratedColorPanel .fields input::-webkit-outer-spin-button, #integratedColorPanel input::-webkit-inner-spin-button{ -webkit-appearance: none; margin: 0;}
#integratedColorPanel .fields input[type=number]{ -moz-appearance:textfield; width: 1ch; min-width: 1ch; padding: 4px 0;}
#integratedColorPanel .fields{color:#989898;text-transform:uppercase; font-size: 13px;}
#integratedColorPanel .fields div{ padding-left: 4px;}
#integratedColorPanel .fields input:focus{ background: #2a2a2a; border: #989898 1px solid; color: #989898; padding: 4px;}
#integratedColorPanel .history{margin-top:10px;display:flex;flex-wrap:wrap;gap:4px;}
#integratedColorPanel .swatch{width:20px;height:20px;border:1px solid black;cursor:pointer;transition:0.2s;}
#integratedColorPanel .buttons{margin-top:6px;display:flex;gap:6px;}
#integratedColorPanel button{
  flex:1;
  padding:6px;
  cursor:pointer;
  width: 30px; 
  height: 30px; 
  max-width: 30px; 
  max-height: 30px;
  border:transparent 2px solid; 
  border-radius: 3px; 
  background-size: 20px 20px !important;
}
#integratedColorPanel #eyedropper{ background: url("./img/tools/eyedropper.svg") no-repeat center center;}
#integratedColorPanel #clearHistory{ background: none no-repeat center center;margin-left: auto;}
#integratedColorPanel #copy{ background: none no-repeat center center;}
#integratedColorPanel #eyedropper.active, #integratedColorPanel #clearHistory:active, #integratedColorPanel #copy:active{border:#545454 2px inset;}
#integratedColorPanel, #integratedColorPanel{margin:0;overflow:hidden;width:100%;height:auto}
#integratedColorPanel .picker{box-sizing:border-box;width:265px;max-width:calc(100% - 8px);margin:0 auto;padding:9px;border-radius:4px;box-shadow:none;zoom:.78}
#integratedColorPanel .tabs{margin-bottom:6px}
#integratedColorPanel .tab{padding:5px 3px;font-size:12px}
#integratedColorPanel .row{margin-bottom:6px}
#integratedColorPanel .preview{height:26px;margin-top:6px}
#integratedColorPanel .fields{font-size:12px}
#integratedColorPanel .fields div{padding-left:2px}
#integratedColorPanel .fields input{margin-top:2px;padding:2px}
#integratedColorPanel .fields input[type=number]{padding:2px 0}
#integratedColorPanel .fields input:focus{padding:2px}
#integratedColorPanel .buttons{margin-top:4px}
#integratedColorPanel .buttons button{height:25px;max-height:25px;width:26px;max-width:26px}
#integratedColorPanel .history{margin-top:5px;gap:3px}
#integratedColorPanel .swatch{width:16px;height:16px}
#integratedColorPanel .tab-content .row{zoom:.70;width:max-content;max-width:100%;margin-left:auto;margin-right:auto}
#integratedColorPanel .picker{width:100%;max-width:100%;padding:7px;zoom:1}
#integratedColorPanel .tabs{margin-bottom:4px}
#integratedColorPanel .tab{padding:4px 2px;font-size:11px}
#integratedColorPanel .preview{height:20px;margin-top:4px}
#integratedColorPanel .fields{font-size:11px;line-height:1.25}
#integratedColorPanel .fields input{margin-top:1px;padding:1px}
#integratedColorPanel .fields input[type=number]{padding:1px 0}
#integratedColorPanel .fields input:focus{padding:1px}
#integratedColorPanel .buttons button{height:23px;max-height:23px;width:24px;max-width:24px}
#integratedColorPanel .history{margin-top:4px;gap:2px}
#integratedColorPanel .swatch{width:14px;height:14px}
#integratedColorPanel, #integratedColorPanel{overflow:hidden;max-width:100%}
#integratedColorPanel .history .swatch:nth-child(n/**/+25){display:none}
#integratedColorPanel .psd-color-pair{display:flex;flex-direction:column;flex:0 0 24px;width:24px;height:140px;margin-left:5px;margin-top:0;gap:0;border:0;border-radius:0;overflow:hidden;box-sizing:border-box}
#integratedColorPanel .psd-color-pair button{display:block;flex:1 1 50%;min-height:0;width:100%;max-width:none;max-height:none;padding:0;margin:0;border:0;border-radius:0;cursor:default;position:relative;background:#000}
#integratedColorPanel .psd-color-pair button+button{border:0}
#integratedColorPanel .psd-color-pair button.selected::after{content:none}
#integratedColorPanel .psd-color-pair button:focus-visible{outline:none}
#integratedColorPanel .tab-content .row{margin-left:0!important;margin-right:0!important;justify-content:flex-start}
#integratedColorPanel .psd-color-pair{flex:0 0 102px;width:102px;min-width:102px}
#integratedColorPanel #hue, #integratedColorPanel #alpha, #integratedColorPanel #lightness, #integratedColorPanel #alphaWheel{width:36px;height:200px;display:block}
#integratedColorPanel .psd-color-pair{height:76px;align-self:flex-start}
#integratedColorPanel{overflow:hidden;min-width:0}#integratedColorPanel .picker{max-width:100%;box-shadow:none}#integratedColorPanel .tab-content .row{transform-origin:top left}

/* Restauro do alinhamento do selector anterior (sem iframe).
   Isola os estilos globais do editor e impede que a amostra seja cortada. */
#integratedColorPanel { box-sizing:border-box; width:100%; overflow:hidden; }
#integratedColorPanel .picker { box-sizing:border-box; width:100%; max-width:100%; padding:7px; margin:0; }
#integratedColorPanel .tabs { display:flex; width:100%; margin:0 0 4px; }
#integratedColorPanel .tab { box-sizing:border-box; flex:1 1 0; min-width:0; text-align:center; }
#integratedColorPanel .tab-content { width:100%; min-width:0; }
#integratedColorPanel .tab-content .row {
  display:flex; flex-wrap:nowrap; align-items:flex-start; justify-content:flex-start;
  width:max-content; max-width:none; margin:0 0 6px !important;
  zoom:.60; gap:0; overflow:visible;
}
#integratedColorPanel #sv, #integratedColorPanel #wheelCanvas {
  box-sizing:content-box; width:200px; height:200px; max-width:none; display:block; flex:none;
}
#integratedColorPanel #hue, #integratedColorPanel #alpha,
#integratedColorPanel #lightness, #integratedColorPanel #alphaWheel {
  box-sizing:content-box; width:36px; height:200px; max-width:none; display:block; flex:none;
}
#integratedColorPanel .psd-color-pair {
  box-sizing:border-box; display:flex; flex-direction:column;
  flex:0 0 102px; width:102px; min-width:102px; height:76px;
  margin:0 0 0 5px; padding:0; border:0; border-radius:0; overflow:hidden;
}
#integratedColorPanel .psd-color-pair button {
  box-sizing:border-box; display:block; flex:1 1 50%;
  width:100%; min-width:100%; max-width:none; min-height:0; max-height:none;
  margin:0; padding:0; border:0; border-radius:0; box-shadow:none;
  appearance:none; background-image:none !important;
}
/* O zoom reduz o conjunto de forma uniforme, mantendo a relação com os separadores. */

/* Separação adicional entre a barra de opacidade e a comparação de cores.
   A largura total permanece constante para preservar o alinhamento com Extrator. */
#integratedColorPanel .psd-color-pair {
  margin-left:17px;
  flex-basis:90px;
  width:90px;
  min-width:90px;
}

/* Barra lateral mais estreita: escala o conjunto grafico sem alterar proporcoes. */
#integratedColorPanel .picker { min-width:0; }
#integratedColorPanel .tabs { width:100%; }
#integratedColorPanel .tab-content .row { zoom:var(--psd-picker-scale, .55); }
#integratedColorPanel .fields { min-width:0; overflow-wrap:anywhere; }
#integratedColorPanel .fields input { max-width:100%; box-sizing:border-box; }

/* Icones fornecidos pelo utilizador para os comandos do Selector de cores. */
#integratedColorPanel .buttons #eyedropper { background: url("../../img/picker/eyedropper.svg") no-repeat center center; background-size:18px 18px !important; }
#integratedColorPanel .buttons #copy { background: url("../../img/picker/copy.svg") no-repeat center center; background-size:18px 18px !important; }
#integratedColorPanel .buttons #clearHistory { background: url("../../img/picker/trash.svg") no-repeat center center; background-size:18px 18px !important; }

/* Ajustes: icones mais pequenos e amostra horizontal mais alta. */
#integratedColorPanel .buttons #eyedropper,
#integratedColorPanel .buttons #copy,
#integratedColorPanel .buttons #clearHistory { background-size: 13px 13px !important; }
#integratedColorPanel .preview { height: 36px; min-height: 36px; margin-top: 6px; box-sizing: border-box; }

/* Altura compacta da amostra horizontal, sem alterar o restante layout. */
#integratedColorPanel .preview { height: 30px; min-height: 30px; }

/* Extrator: quatro amostras quadradas na largura do painel. */
#integratedColorPanel .extractor-hint { display:none; }
#integratedColorPanel .extractor-palette { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:5px; width:100%; box-sizing:border-box; padding:3px 0 8px; }
#integratedColorPanel .extractor-swatch { aspect-ratio:1; width:100%; min-width:0; border:1px solid #777; border-radius:2px; background:#444; cursor:pointer; padding:0; }
#integratedColorPanel .extractor-swatch:disabled { cursor:default; opacity:.45; }
#integratedColorPanel .extractor-swatch:not(:disabled):hover { outline:2px solid #ddd; outline-offset:1px; }

/* Selector ampliado: a comparacao de cores cede espaco ao quadro e a roda.
   O conjunto e escalado pelo fitPicker para nunca ultrapassar a largura util. */
#integratedColorPanel .tab-content .row {
  box-sizing: border-box;
  zoom: var(--psd-picker-scale, .8);
}
#integratedColorPanel .psd-color-pair {
  flex: 0 0 48px;
  width: 48px;
  min-width: 48px;
  margin-left: 8px;
  height: 76px;
}

/* Barras de claridade e transparencia 1/3 mais estreitas; amostras maiores.
   Mantem o ajuste proporcional ao espaco disponivel na barra lateral. */
#integratedColorPanel #hue, #integratedColorPanel #alpha,
#integratedColorPanel #lightness, #integratedColorPanel #alphaWheel {
  width:29px;
}
#integratedColorPanel .psd-color-pair {
  flex:0 0 76px;
  width:76px;
  min-width:76px;
}

/* Amostras actual/alterada compactas: não ultrapassam o alinhamento das abas. */
#integratedColorPanel .psd-color-pair {
  flex: 0 0 52px;
  width: 52px;
  min-width: 52px;
  height: 56px;
  max-height: 56px;
  margin-left: 7px;
}
#integratedColorPanel .psd-color-pair button {
  flex: 1 1 50%;
  min-height: 0;
}

/* Ajuste final: selector ligeiramente menor e amostras alinhadas com a
   extremidade direita das abas (incluindo Extrator). */
#integratedColorPanel .tab-content .row {
  width: calc(var(--psd-picker-available, 280px) / var(--psd-picker-scale, .8));
  max-width: none;
  justify-content: space-between;
  gap: 0;
}
#integratedColorPanel .psd-color-pair {
  margin-left: auto;
  margin-right: 0;
}

/* Aproximar as amostras da barra de transparência, sem espaçamento elástico. */
#integratedColorPanel .tab-content .row {
  justify-content: flex-start;
  width: max-content;
  max-width: none;
  gap: 0;
}
#integratedColorPanel .psd-color-pair {
  margin-left: 3px;
  margin-right: 0;
}

/* Quadro e roda repostos aos 200 px originais (+7 px face aos 193 px anteriores).
   Sem zoom no elemento, os cursores mantêm as coordenadas correctas. */
/* Mais 3 px de separacao face a versao anterior (3 -> 6 px). */
#integratedColorPanel .psd-color-pair {
  margin-left: 6px;
}

/* Mais 4 px entre a barra de transparência e as amostras: 6 -> 10 px. */
#integratedColorPanel .psd-color-pair {
  margin-left: 10px;
}

/* 7CY: permitir captura de ponteiro sem gestos de scroll durante o arrasto. */
#integratedColorPanel #sv, #integratedColorPanel #wheelCanvas, #integratedColorPanel #hue, #integratedColorPanel #alpha, #integratedColorPanel #lightness, #integratedColorPanel #alphaWheel { touch-action: none; }
