/* COBAT V2.4.175 — palette outils Autocontrôle / DA COBAT */
:root{--cobat-tool-blue:#0B5CAD;--cobat-tool-blue-deep:#073763;--cobat-tool-blue-soft:#D8ECFF;--cobat-tool-bordeaux:#7A1720;--cobat-tool-bordeaux-soft:#F7C8CF}

/* La palette reste disponible : le bouton Outils ne masque plus les outils, il ne fait qu'afficher les libellés. */
body:not(.acm-mobile) .floating-toolbox{
  width:54px;max-height:calc(100% - 28px);box-sizing:border-box;padding:6px;overflow:visible;
  background:rgba(255,255,255,.985);border:1px solid #d4e0e8;border-radius:14px;
  box-shadow:0 10px 28px rgba(19,55,83,.16);backdrop-filter:blur(8px);
  transition:width .16s ease,box-shadow .16s ease,border-color .16s ease
}
body:not(.acm-mobile) .floating-toolbox.open{width:174px;border-color:#bdd2e4;box-shadow:0 12px 32px rgba(7,55,99,.18)}
body:not(.acm-mobile) .palette-launcher{
  width:42px;height:42px;min-height:42px;flex:0 0 42px;padding:0 10px;justify-content:flex-start;gap:10px;
  background:var(--cobat-tool-blue-deep);border:1px solid var(--cobat-tool-blue-deep);color:#fff;border-radius:10px
}
body:not(.acm-mobile) .floating-toolbox.open .palette-launcher{width:160px;background:var(--cobat-tool-blue-deep);border-color:var(--cobat-tool-blue-deep)}
body:not(.acm-mobile) .palette-launcher:hover,body:not(.acm-mobile) .palette-launcher:focus-visible{background:var(--cobat-tool-blue);border-color:var(--cobat-tool-blue)}
body:not(.acm-mobile) .palette-launcher svg{width:20px;height:20px;flex:0 0 20px}
.palette-launcher-label{display:none;font-size:11px;font-weight:700;letter-spacing:.02em;white-space:nowrap}
body:not(.acm-mobile) .floating-toolbox.open .palette-launcher-label{display:inline}

body:not(.acm-mobile) .palette-tools-body{
  display:flex!important;flex-direction:column;align-items:stretch;gap:3px;width:42px;max-height:calc(100vh - 190px)!important;
  opacity:1!important;visibility:visible!important;pointer-events:auto!important;transform:none!important;margin-top:6px!important;
  overflow-y:auto!important;overflow-x:hidden!important;scrollbar-width:none
}
body:not(.acm-mobile) .palette-tools-body::-webkit-scrollbar{display:none}
body:not(.acm-mobile) .floating-toolbox.open .palette-tools-body{width:160px}
body:not(.acm-mobile) .palette-btn{
  width:42px;height:39px;min-height:39px;flex:0 0 39px;justify-content:flex-start;gap:10px;padding:0 10px;
  border:1px solid transparent;border-radius:9px;color:#425868;background:transparent;box-sizing:border-box;transition:.12s ease
}
body:not(.acm-mobile) .floating-toolbox.open .palette-btn{width:160px}
body:not(.acm-mobile) .palette-btn svg{width:19px;height:19px;flex:0 0 19px;stroke-width:1.75}
body:not(.acm-mobile) .palette-btn:hover{background:#f1f6fa;border-color:#d9e5ed;color:var(--cobat-tool-blue-deep)}
body:not(.acm-mobile) .palette-btn.active{background:var(--cobat-tool-blue-soft);border-color:#a9cbe8;color:var(--cobat-tool-blue);box-shadow:inset 3px 0 0 var(--cobat-tool-blue)}
body:not(.acm-mobile) .palette-btn.danger{color:var(--cobat-tool-bordeaux)}
body:not(.acm-mobile) .palette-btn.danger:hover{background:#fff4f5;border-color:#e5bbc0;color:var(--cobat-tool-bordeaux)}
body:not(.acm-mobile) .palette-btn.danger.active{background:#fdebed;border-color:#dda9af;color:var(--cobat-tool-bordeaux);box-shadow:inset 3px 0 0 var(--cobat-tool-bordeaux)}
.palette-label{display:none;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:10.5px;font-weight:650;line-height:1;color:inherit}
body:not(.acm-mobile) .floating-toolbox.open .palette-label{display:block}
body:not(.acm-mobile) .palette-group-label{display:none;margin:6px 8px 2px;padding:0;text-align:left;color:#7a8e9d;font-size:7px;font-weight:750;letter-spacing:.09em;text-transform:uppercase}
body:not(.acm-mobile) .floating-toolbox.open .palette-group-label{display:block}
body:not(.acm-mobile) .palette-sep{width:28px;margin:3px auto;background:#dce6ec}
body:not(.acm-mobile) .floating-toolbox.open .palette-sep{width:142px}

body:not(.acm-mobile) .palette-color-dock{width:42px;margin-top:2px}
body:not(.acm-mobile) .floating-toolbox.open .palette-color-dock{width:160px}
body:not(.acm-mobile) .palette-color-trigger{width:42px;height:40px;border-radius:9px;border:1px solid transparent;background:#f8fafb;color:#536a79;padding:0;display:flex;align-items:center;justify-content:center;gap:9px}
body:not(.acm-mobile) .floating-toolbox.open .palette-color-trigger{width:160px;justify-content:flex-start;padding:0 10px}
body:not(.acm-mobile) .palette-color-swatch{width:20px;height:20px;border-radius:6px;box-shadow:0 0 0 1px #b7c5ce}
body:not(.acm-mobile) .palette-color-trigger small{display:none;font-size:10px;font-weight:650;color:#536a79}
body:not(.acm-mobile) .floating-toolbox.open .palette-color-trigger small{display:block}
body:not(.acm-mobile) .palette-color-popover{left:calc(100% + 8px);right:auto;bottom:0}
body:not(.acm-mobile) .floating-toolbox:not(.open) .palette-btn[data-tip]::after,
body:not(.acm-mobile) .floating-toolbox:not(.open) .palette-color-trigger[data-tip]::after{display:block}
body:not(.acm-mobile) .floating-toolbox.open .palette-btn[data-tip]::after,
body:not(.acm-mobile) .floating-toolbox.open .palette-color-trigger[data-tip]::after{display:none}

/* Les réglages se décalent quand les libellés de la palette sont ouverts. */
@media(min-width:768px){
  body:not(.acm-mobile) .viewer-pane:has(.floating-toolbox.open) .tool-options{left:198px}
  body:not(.acm-mobile) .tool-options{transition:left .16s ease}
}

/* Annotations au-dessus du PDF et sous les repères métier. */
.annotation-layer{z-index:12!important}
.marker-layer{z-index:14!important}
.link-layer{z-index:13!important}
.annotation-draw,.annotation-polyline,.annotation-measure,.annotation-arrow-hit{pointer-events:stroke!important}
.annotation-text,.annotation-symbol,.measure-label{pointer-events:auto!important}
.annotation-layer .historical-revision{opacity:.72}

/* Palette téléphone/tablette : même identité graphique que PC sans changer son fonctionnement tactile. */
@media(max-width:767px){
  #acmPcPaletteDock{border-color:#cfdae3!important;background:rgba(255,255,255,.985)!important;box-shadow:0 10px 28px rgba(7,55,99,.17)!important}
  .acm-pc-palette-toggle{background:var(--cobat-tool-blue-deep)!important;border-color:var(--cobat-tool-blue-deep)!important;color:#fff!important}
  .acm-pc-palette-btn{color:var(--cobat-tool-blue-deep)!important;border-color:transparent!important}
  .acm-pc-palette-btn.active{background:var(--cobat-tool-blue-soft)!important;border-color:#aacbe6!important;color:var(--cobat-tool-blue)!important;box-shadow:inset 0 -3px 0 var(--cobat-tool-blue)!important}
  .acm-pc-palette-btn[data-pc-target="deleteToolBtn"]{color:var(--cobat-tool-bordeaux)!important}
  .acm-pc-palette-btn>span:last-child{color:#506878!important}
  .acm-pc-palette-btn.active>span:last-child{color:var(--cobat-tool-blue)!important}
}

/* V2.4.179 — palette symboles ultra compacte + infobulles DA COBAT */
#toolOptions:has(#symbolOptions:not(.hidden)){
  min-width:118px;
  width:118px;
  max-width:118px;
  padding:8px;
}
#symbolOptions{
  align-items:stretch!important;
  gap:6px!important;
  min-width:0;
  width:100%;
  max-width:100%;
}
#symbolOptions .symbol-options-head,
#symbolOptions .symbol-options-caption,
#symbolOptions .symbol-drag-hint,
#symbolOptions .tool-options-title{
  display:none!important;
}
#symbolOptions .symbol-choice-group{
  display:grid;
  grid-template-columns:minmax(0,1fr);
  gap:5px;
  width:100%;
}
#symbolOptions .symbol-choice{
  position:relative;
  width:100%;
  min-width:0;
  height:34px;
  border-radius:9px;
  padding:0;
  justify-content:center;
  gap:0;
  font-size:12px;
  font-weight:700;
  color:#344a5a;
  box-shadow:0 1px 0 rgba(12,34,51,.02);
  overflow:visible;
}
#symbolOptions .symbol-choice:hover{
  border-color:#c7d7e3;
  background:#f6fafc;
}
#symbolOptions .symbol-choice.active{
  background:#0B5CAD;
  border-color:#0B5CAD;
  color:#fff;
}
#symbolOptions .symbol-choice::after{
  content:attr(aria-label);
  position:absolute;
  left:calc(100% + 10px);
  top:50%;
  transform:translateY(-50%);
  padding:7px 10px;
  border-radius:8px;
  background:rgba(10,12,16,.82);
  color:#fff;
  border:1px solid rgba(78,163,255,.28);
  box-shadow:0 8px 24px rgba(7,24,40,.22);
  font-size:11px;
  font-weight:700;
  letter-spacing:.01em;
  line-height:1;
  white-space:nowrap;
  opacity:0;
  pointer-events:none;
  transition:opacity .14s ease, transform .14s ease;
  z-index:60;
}
#symbolOptions .symbol-choice::before{
  content:'';
  position:absolute;
  left:100%;
  top:50%;
  transform:translateY(-50%);
  border:6px solid transparent;
  border-right-color:rgba(10,12,16,.82);
  opacity:0;
  transition:opacity .14s ease;
  pointer-events:none;
  z-index:59;
}
#symbolOptions .symbol-choice:hover::after,
#symbolOptions .symbol-choice:hover::before,
#symbolOptions .symbol-choice:focus-visible::after,
#symbolOptions .symbol-choice:focus-visible::before{
  opacity:1;
}
#symbolOptions .symbol-choice:hover::after,
#symbolOptions .symbol-choice:focus-visible::after{
  transform:translateY(-50%) translateX(2px);
}
#symbolOptions .symbol-choice-icon{
  width:20px;
  height:20px;
  flex:0 0 20px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
#symbolOptions .symbol-choice-icon svg{
  width:17px;
  height:17px;
  display:block;
  overflow:visible;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
#symbolOptions .symbol-choice-label{
  display:none!important;
}
#symbolOptions .symbol-options-footer{
  display:flex;
  flex-direction:column;
  align-items:stretch;
  gap:6px;
  width:100%;
  margin-top:2px;
}
#symbolOptions .tool-option-label{
  width:100%;
  justify-content:center;
  font-size:0;
  line-height:0;
}
#symbolOptions .tool-option-select{
  min-width:0;
  width:100%;
  height:30px;
  font-size:11px;
}
#symbolOptions .style-color{
  width:30px;
  height:30px;
}
#symbolToolBtn svg rect,
#symbolToolBtn svg path{
  stroke-linejoin:round;
}
@media(max-width:767px){
  #toolOptions:has(#symbolOptions:not(.hidden)){
    min-width:108px;
    width:108px;
    max-width:108px;
    padding:7px;
  }
  #symbolOptions .symbol-choice{
    height:32px;
  }
  #symbolOptions .symbol-choice-icon{
    width:18px;
    height:18px;
    flex-basis:18px;
  }
  #symbolOptions .symbol-choice-icon svg{
    width:15px;
    height:15px;
  }
}
