tableware-preview, tableware-grid, tableware-statusbar {
    font-family: monospace;
    font-size: 11pt;
}

tableware-preview {
    position: absolute;
    top: 0;
    left: 0;
    height: 16pt;
    line-height: 16pt;
    display: block;
    width: 100vw;
    max-width: 100vw;
    white-space: pre;
    overflow: hidden;
    text-overflow: ellipsis;
    border-bottom: 1px solid #AAA;
    background: #FFF;
    color: #000;
    padding: 0 4pt;
}

tableware-grid {
    position: absolute;
    top: 16pt;
    left: 0;
    right: 0;
    bottom: 16pt;
    display: block;
    overflow-x: scroll;
    overflow-y: hidden;
    background: #BBB;
}

tableware-grid table {
    position: sticky;
    top: 0;
    table-layout: fixed;
    transition: all .5s ease;
}

tableware-grid.slow table {
    filter: invert(.3);
    pointer-events: none;
    transition: all .5s ease;
}

tableware-grid table td {
    max-width: 20em;
    white-space: pre;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: default;
    border-right: 1px solid #CCC;
    border-bottom: 1px solid #CCC;
}

tableware-grid table td.frozen {
    position: sticky;
    left: 0;
}

tableware-grid table thead td.frozen {
    border-bottom: 1px solid #AAA;
    border-right: 1px solid #999;
}

tableware-grid table tbody td.frozen {
    border-right: 0;
    background: #EEE;
    border-bottom: 1px solid #AAA;
    border-right: 1px solid #222;
}

tableware-grid table td:last-child {
    border-right: 0;
}

tableware-grid table thead td {
    background: #444;
    color: #FFF;
    padding: 0 4pt;
}

tableware-grid table tbody td {
    background: #FFF;
    padding: 0 4pt;
}

tableware-grid table tbody tr.selected td {
    background: #E0E0E0;
}

tableware-grid table td.selected {
    background: #888 !important;
    color: #FFF;
    cursor: text !important;
}

tableware-grid table td:not(.selected) {
    user-select: none;
    -moz-user-select: -moz-none;
    -khtml-user-select: none;
    -webkit-user-select: none;
    -o-user-select: none;
}

tableware-statusbar {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 16pt;
    line-height: 16pt;
    display: block;
    width: 100vw;
    max-width: 100vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    border-top: 1px solid #FFF;
    background: #888;
    color: #FFF;
    padding: 0 4pt;
}

tableware-status-message {
    display: inline;
}

tableware-preview:hover, tableware-preview.hovered {
    height: unset;
    min-height: 16pt;
    white-space: unset;
    overlow: visible;
    text-overflow: unset;
}

tableware-preview em {
    font-style: normal;
    font-weight: 700 !important;
}

tableware-preview em {
    user-select: none;
    -moz-user-select: -moz-none;
    -khtml-user-select: none;
    -webkit-user-select: none;
    -o-user-select: none;
}

tableware-preview {z-index: 2}
tableware-grid {z-index: 1}
tableware-statusbar {z-index: 2}
