/* Cosmo Chart 0.11.26 — compact, genuinely clickable footer.
   Only footer layout is changed; the approved drawing-tools rail stays intact. */
#cosmo-tool-rail .cosmo-rail-footer{
  margin-top:auto!important;
  padding:8px 4px 7px!important;
  gap:5px!important;
  display:flex!important;
  flex-direction:column!important;
  border-top:1px solid var(--mono-border,#344051)!important;
}
#cosmo-tool-rail .cosmo-footer-history,
#cosmo-tool-rail .cosmo-footer-actions{
  display:grid!important;
  align-items:stretch!important;
  width:100%!important;
  gap:3px!important;
}
#cosmo-tool-rail .cosmo-footer-history{
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
}
#cosmo-tool-rail .cosmo-footer-actions{
  grid-template-columns:repeat(3,minmax(0,1fr))!important;
  padding-top:5px!important;
  border-top:1px solid color-mix(in srgb,var(--mono-border,#344051) 55%,transparent)!important;
}
#cosmo-tool-rail .cosmo-footer-history > button,
#cosmo-tool-rail .cosmo-footer-actions > button,
#cosmo-tool-rail .cosmo-footer-actions > #bottom-trash{
  grid-column:auto!important;
  box-sizing:border-box!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  align-items:center!important;
  gap:2px!important;
  width:100%!important;
  min-width:0!important;
  height:41px!important;
  min-height:41px!important;
  max-height:41px!important;
  padding:4px 0!important;
  border:1px solid transparent!important;
  border-radius:8px!important;
  background:transparent!important;
  cursor:pointer!important;
  color:var(--mono-text,#e6ebf2)!important;
  transition:background-color .12s,border-color .12s!important;
  font:500 9px/1.1 system-ui,Segoe UI,sans-serif!important;
}
#cosmo-tool-rail .cosmo-footer-actions > #bottom-trash {color:var(--mono-danger,#ec828b)!important;}
#cosmo-tool-rail .cosmo-footer-history > button svg,
#cosmo-tool-rail .cosmo-footer-actions > button svg.ico{
  width:19px!important; height:19px!important;
  min-width:19px!important;max-width:19px!important;
  flex-shrink:0!important;
  fill:none!important;stroke:currentColor!important;
  stroke-width:1.75!important;stroke-linecap:round!important;stroke-linejoin:round!important;
}
#cosmo-tool-rail .cosmo-footer-history > button span,
#cosmo-tool-rail .cosmo-footer-actions > button .cosmo-footer-action-label,
#cosmo-tool-rail .cosmo-footer-actions > #bottom-trash span{
  display:block!important;
  position:static!important;
  width:auto!important;height:auto!important;
  padding:0!important;margin:0!important;
  clip:auto!important;overflow:hidden!important;
  max-width:100%!important;
  text-overflow:clip!important;
  white-space:nowrap!important;
  visibility:visible!important;
  color:inherit!important;
  font:inherit!important;
}
#cosmo-tool-rail .cosmo-footer-actions > button .cosmo-footer-action-label,
#cosmo-tool-rail .cosmo-footer-actions > #bottom-trash span {
  font-size:8px!important;
  letter-spacing:-.35px!important;
}
#cosmo-tool-rail .cosmo-rail-footer button:hover{
  background:var(--mono-raise,#263449)!important;
  border-color:var(--mono-border,#344051)!important;
}
#cosmo-tool-rail .cosmo-rail-footer button:focus-visible{
  outline:2px solid var(--mono-focus,#60aeff)!important;outline-offset:-2px!important;
}
#cosmo-tool-rail .cosmo-footer-actions > button[aria-pressed="true"]{
  background:color-mix(in srgb,var(--mono-focus,#60aeff) 16%,transparent)!important;
  color:#8ac6ff!important;
}
/* Very narrow rail: keep 5 large icon targets rather than clipped text. */
#cosmo-tool-rail[data-size="small"] .cosmo-footer-history > button span,
#cosmo-tool-rail[data-size="small"] .cosmo-footer-actions > button span,
#cosmo-tool-rail[data-size="small"] .cosmo-footer-actions > #bottom-trash span{
  display:none!important;
}
#cosmo-tool-rail[data-size="small"] .cosmo-footer-history > button,
#cosmo-tool-rail[data-size="small"] .cosmo-footer-actions > button{
  height:36px!important;min-height:36px!important;max-height:36px!important;
}
@media (max-height:690px){
 #cosmo-tool-rail .cosmo-rail-footer{gap:3px!important;padding:3px 3px 4px!important;}
 #cosmo-tool-rail .cosmo-footer-history > button,
 #cosmo-tool-rail .cosmo-footer-actions > button{height:34px!important;min-height:34px!important;max-height:34px!important;gap:0!important;}
 #cosmo-tool-rail .cosmo-footer-history > button span,
 #cosmo-tool-rail .cosmo-footer-actions > button span,
 #cosmo-tool-rail .cosmo-footer-actions > #bottom-trash span{display:none!important;}
}
@media (prefers-reduced-motion:reduce){
 #cosmo-tool-rail .cosmo-rail-footer button{transition:none!important;}
}
/* The 3 action cells of a classic 90px tool rail cannot fit Russian labels;
   keep full tooltips/accessible names and show clean, larger icons instead. */
#cosmo-tool-rail{container-type:inline-size;}
@container (max-width:119px){
 .cosmo-footer-actions > button .cosmo-footer-action-label,
 .cosmo-footer-actions > #bottom-trash span{display:none!important;}
 .cosmo-footer-actions > button svg.ico{width:20px!important;height:20px!important;min-width:20px!important;max-width:20px!important;}
}
@media(max-height:690px){
 #cosmo-tool-rail .cosmo-footer-actions > #bottom-trash{height:34px!important;min-height:34px!important;max-height:34px!important;}
}
/* Icon-only action row fits inside the default 90px rail without clipped text. */
#cosmo-tool-rail .cosmo-footer-actions > button .cosmo-footer-action-label,
#cosmo-tool-rail .cosmo-footer-actions > #bottom-trash span{display:none!important;}
@container (min-width:140px){
 #cosmo-tool-rail .cosmo-footer-actions > button .cosmo-footer-action-label,
 #cosmo-tool-rail .cosmo-footer-actions > #bottom-trash span{display:block!important;}
}
/* Give the three actions a >=24px hit width on the usual 90px rail. */
#cosmo-tool-rail .cosmo-rail-footer{padding-left:0!important;padding-right:0!important;}
#cosmo-tool-rail .cosmo-footer-actions{gap:2px!important;}

/* v0.11.27: visibility/lock/clear ABOVE undo/redo, with separator below. */
#cosmo-tool-rail .cosmo-footer-actions{border-top:0!important;padding-top:0!important;}
#cosmo-tool-rail .cosmo-footer-history{border-top:1px solid color-mix(in srgb,var(--mono-border,#344051) 55%,transparent)!important;padding-top:5px!important;}
