body { font-family: 'Helvetica Neue', Verdana, Helvetica, Arial, sans-serif; max-width: 600px; margin: 0 auto; padding-top: 72px; -webkit-font-smoothing: antialiased; font-size: 1.125em; color: #333; line-height: 1.5em; } h1, h2, h3 { color: #000; } h1 { font-size: 2.5em } h2 { font-size: 2em } h3 { font-size: 1.5em } a { text-decoration: none; color: #09f; } a:hover { text-decoration: underline; } table { border-collapse: collapse; } td, th { border: 1px solid black; padding: 0; } th { text-align: center; min-width: 40px; } td { text-align: right; position: relative; } td input { border: none; padding: 5px; width: 80px; } td input:hover { background-color: #ccc; } td input:focus { background-color: #ccf; } td input:not(:focus) { text-align: right; } .smartborder { width: calc(100% + 2px); height: calc(100% + 2px); border: 3px solid blue; position: absolute; left: -4px; top: -4px; background: none; z-index: 999; /*pointer-events: none;*/ } td input:not(:focus) + .smartborder { visibility: hidden; } .smartborder .button { --button-size: 20px; --half-button-size: 10px; /*pointer-events: all;/* TODO check this (what is "initial"?) */ width: var(--button-size); height: var(--button-size); background-color: blue; color: white; border-radius: var(--half-button-size); position: absolute; } .extendrange.button { left: 100%; top: 100%; } .fillrange.button { top: 100%; left: calc(50% - var(--half-button-size)); } .moverange.button { top: calc(50% - var(--half-button-size)); left: calc(0px - var(--button-size)); } .emptyrange.button { top: calc(0px - var(--button-size)); left: calc(100% - var(--button-size) - 5px); } .deleterange.button { top: calc(0px - var(--button-size)); left: 100%; } .copyrange.button { top: calc(0px - var(--button-size)); left: 0; }