#convolution-container {
    position: relative;
    width: 100%;
}

/*
 * Ensure the canvas has integer dimensions,
 * making it easy to match the sample image:
 */
canvas#convolution-canvas {
    padding: 0;
    margin: 0;
    image-rendering: -moz-crisp-edges;  /* no blur on retina screens (fallback for firefox) */
    image-rendering: pixelated;  /* no blur on retina screens (unsupported on firefox) */
    background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAAJ0lEQVQoU2O8e/fufwYkoKSkhMxlYKSDgv///6O44d69e6huoL0CALpMKlF6PO5uAAAAAElFTkSuQmCC");
    background-repeat: repeat;
}

#convolution-controls input[type="checkbox"] {
    margin-left: 15px;
}

table#convolution-matrix {
    position: absolute;
    top: 16px; right: 16px; left: auto; bottom: auto;
    width: fit-content !important;
    height: fit-content !important;
    width: -moz-fit-content !important;
    height: -moz-fit-content !important;
    border-spacing: 0;
    border-collapse: collapse;
    z-index: 2;
    opacity: 0.92;
    visibility: hidden;  /* shown with javascript */
    border: 1px solid #ccc;
    background: #fff;
}

table#convolution-matrix tr:not(:last-of-type) {
    border-bottom: 1px dashed #ccc;
}

table#convolution-matrix td:not(:last-of-type) {
    border-right: 1px dashed #ccc;
}

table#convolution-matrix td {
    margin: 0;
    padding: 0;
}

table#convolution-matrix input[type="text"] {
    width: 6ch;
    padding: 4px;
    margin: 0;
    font-family: monospace;
    font-size: 13px;
    border: none;
    text-align: right;
    -webkit-appearance: none;  /* no rounded buttons on iOS */
}

a.sample-matrix {
    text-decoration: none;
    border-bottom: 1px dashed #fdcf1a;
}

@media (max-width: 580px) {
    .convolution-option {
        display: block;
    }

    .convolution-option:first-of-type {
        margin-top: 10px;
    }
}
