chunk::before {
    display: block;
    content: counter(seqpos);
    font-size: 80%;
    text-align: end;
    width: 100%;
    vertical-align: bottom;
    color: black;
}

chunk[last]::before {
    content: none;
}

chunk {
    display: inline-block;
    padding-left: 0.25ch;
    padding-right: 0.25ch;
    counter-increment: seqpos 20;
    padding-top: 0.5em;
}

cut {
    display: inline-block;
    position: relative;
    height: 1em;
    z-index: -1;
    vertical-align: bottom;
    left: -2px;
    width: 4px;
    margin-right: -4px;
}

cut[enz=a] {
    background-color: tomato;
    height: 1.5em;
    margin-top: -0.5em;
}

cut[enz=b] {
    background-color: blue;
    height: 1.5em;
    margin-bottom: -0.5em;
}

aa[out] {
    color: #999;
    opacity: 0.55;
}

aa[ambiguous] {
    color: #8e44ad;
}

aa.pep-hover {
    background-color: #fff59d;
}

body {
    background-color: aliceblue;
}

#uniprot-row, #enz_a, #enz_b, #seq-panel, #mass-filter {
    border: 1px solid lightsteelblue;
    border-radius: 10px;
    background-color: white;
    padding: 1em;
}

#enz_a {
    border: 3px solid tomato;
}

#enz_b {
    border: 3px solid blue;
}

#uniprot-row {
    margin-bottom: 1em;
    display: flex;
    align-items: center;
    gap: 0.4em;
}

#permalink-box {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.4em;
}

.mw {
    margin: 0 0.75em;
    /* The same muted grey as the residue count beside them: all four are
       readouts about the sequence rather than things to act on. */
    color: dimgray;
}

#uniprot_status {
    color: dimgray;
}

#uniprot_status.bad {
    color: #b00020;
}

#main {
    display: flex;
    align-items: stretch;
    gap: 2em;
}

#seq-panel {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

#enzymes {
    display: flex;
    flex-direction: column;
    gap: 1em;
    flex: 0 0 auto;
}

#enz_a, #enz_b {
    display: flex;
    flex-direction: column;
    gap: 0.2em;
}

div[class^="spec"] {
    display: flex;
    align-items: center;
    gap: 0.4em;
}

.poslabel {
    flex: 0 0 2.5em;
    text-align: right;
}

#charges {
    display: flex;
    gap: 0.8em;
    margin-top: 0.5em;
}

#cys-mod {
    display: flex;
    align-items: center;
    gap: 0.4em;
    margin-top: 0.5em;
}

#export-row {
    display: flex;
    align-items: center;
    gap: 0.4em;
    margin-top: 0.75em;
}

#export_status {
    color: dimgray;
}

#export_status.bad {
    color: #b00020;
}

#seq {
    width: 100%;
    flex: 1 1 auto;
    min-height: 20em;
    font-family: monospace;
    overflow: auto;
    color: black;
    counter-reset: seqpos 0;
    isolation: isolate;
}

#seq:focus {
    outline: none;
}

/* Generated content, so it can't be edited or land in textContent. The class
   is toggled from render() rather than using :empty, because a focused empty
   contenteditable picks up a bogus <br> in some browsers. */
#seq.empty::before {
    content: attr(data-placeholder);
    color: #999;
    font-family: sans-serif;
}

#pep-popup {
    position: fixed;
    z-index: 1000;
    background: white;
    border: 1px solid lightsteelblue;
    border-radius: 8px;
    padding: 0.5em 0.7em;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    font-size: 0.85em;
    font-family: sans-serif;
}

#pep-popup .pep-popup-title {
    font-family: monospace;
    font-weight: bold;
    max-width: 24em;
    overflow-wrap: break-word;
    /* The range sits directly under the sequence it belongs to, so the gap
       below the two of them is the one that separates them from the table. */
    margin-bottom: 0.15em;
}

#pep-popup .pep-popup-range {
    color: dimgray;
    margin-bottom: 0.4em;
}

#pep-popup table {
    border-collapse: collapse;
}

#pep-popup th, #pep-popup td {
    padding: 0.1em 0.6em;
    text-align: right;
}

#pep-popup th:first-child, #pep-popup td:first-child {
    text-align: left;
}

#pep-popup tr.row-out {
    color: #999;
    opacity: 0.55;
}

