.scripto.no-actions div[role="main"]>h1:first-of-type {
    padding-right: 0;
}

.scripto div[role="main"]>h1:first-of-type .title {
    max-width: 50%;
}

.browse .scripto-media td:first-child, 
.browse .scripto-media th:first-child {
    width: 36px;
}

.browse .scripto-media .row-number {
    width: 3em;
}

.browse .scripto-media .row-title {
    width: 50%;
}

.browse .scripto-revisions td {
    width: 100%;
    vertical-align: top;
}

.browse .scripto-revisions td .tablesaw-cell-content {
    flex-wrap: wrap;
}

.browse .scripto-revisions td:first-child,
.browse .scripto-revisions th:first-child {
    width: auto;
}

.green {
    color: green;
}

.red {
    color: red;
}

.layout {
    display: inline-flex;
    align-items: center;
}

.layout label {
    display: inline-block;
    margin-right: 12px;
}

.layout button {
    margin-bottom: 0;
    box-shadow: none;
    border: 1px solid #dfdfdf;
    position: relative;
    width: 38px;
}

.layout button:after {
    font-family: "Font Awesome 5 Free";
    display: inline-block;
    font-weight: 900;
}

.layout button:hover {
    z-index: 1;
    box-shadow: none !important;
}

.layout button:not(:disabled):hover {
    border: 1px solid #999;
}

.layout .horizontal {
    border-radius: 3px 0 0 3px;
}

.layout .horizontal:after {
    content: "\f337";
}

.layout .vertical {
    border-radius: 0 3px 3px 0;
    margin-left: -1px;
}

.layout .vertical:after {
    content: "\f338";
}

.wikitext-flex {
    display: flex; 
    width: 100%;
    flex-wrap: wrap;
    margin-top: 12px;
    min-height: 400px;
 }

.browse .browse-controls {
    justify-content: space-between;
    width: 100%;
    clear: both;
}

.browse .browse-controls > form,
.browse .browse-controls > div,
.browse .browse-controls > nav {
    width: 50%;
}

.browse .browse-controls > *:nth-child(2n) {
    text-align: right;
}

#scripto-search {
    order: 1;
}

#scripto-search input[type="text"] {
    border-right: 0;
}

#scripto-search button {
    border-radius: 0 3px 3px 0;
    vertical-align: top;
}

.browse .sorting {
    order: 2;
    text-align: right;
}

.browse nav.pagination {
    display: flex;
    order: 3;
}

.project.browse:not(.review) nav.pagination {
    order: 1;
}

.browse nav.pagination form, 
.browse nav.pagination .button, 
.browse nav.pagination .row-count {
    float: none;
}

.browse .filtering {
    order: 4;
    margin-left: 0;
}

.scripto.browse th.comment {
    width: 25%;
}

.compare-selected {
    margin: 6px auto 6px 0;
}

.revision nav.pagination,
.media.show nav.pagination {
    float: right;
    justify-content: flex-end;
    margin: 6px 0 0;
    position: relative;
    z-index: 1;
}

.item.show nav.pagination {
    justify-content: flex-start;
    margin-top: 0;
}

nav.pagination .button:first-child {
    border-radius: 3px 0 0 3px;
}

nav.pagination .button:last-child {
    border-radius: 0 3px 3px 0;
}

#wikitext.active {
    display: flex; 
    justify-content: space-between; 
}

.wikitext-featherlight {
    width: 100%;
}

.horizontal .wikitext-flex .textarea-flex {
    display: flex;
    margin-right: 12px;
    flex-direction: column;
}

.wikitext-flex .textarea-flex textarea {
    width: 100%;
    min-height: 100%;
    flex: 1;
}

.horizontal .wikitext-flex .textarea-flex,
.horizontal .wikitext-flex .panzoom-container {
    width: calc(50% - 6px);
}

.vertical .wikitext-flex .textarea-flex,
.vertical .wikitext-flex .panzoom-container {
    width: 100%;
}

.vertical .wikitext-flex .textarea-flex {
    order: 2;
    min-height: 35vh;
}

.vertical .wikitext-flex .panzoom-container {
    order: 1;
    margin-bottom: 24px;
    height: 35vh;
}

.wikitext-flex .panzoom-container {
    border: 1px solid #dfdfdf;
}

.wikitext-flex .media-render {
    margin-bottom: 0;
}

.wikitext-flex .media-render img {
    vertical-align: bottom;
}

.zoom-controls {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 1;
    display: flex;
}

.zoom-controls button {
    position: relative;
    overflow: hidden;
    border-radius: 0;
    margin-left: -1px;
    box-shadow: none;
    border: 1px solid #dfdfdf;
    min-height: 0;
    padding: 3px 6px;
    font-size: 14px;
    line-height: 21px;
}

.zoom-controls button:first-child {
    border-radius: 3px 0 0 3px;
}

.zoom-controls button:last-child {
    border-radius: 0 3px 3px 0;
}

.zoom-controls button:after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    left: 0;
    background-color: #fff;
    z-index: -1;
}

.zoom-controls button:before {
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
}

.zoom-in:before {
    content: "\f00e";
}

.zoom-out:before {
    content: "\f010";
}

.rotate-left:before {
    content: "\f2ea";
}

.rotate-right:before {
    content: "\f2f9";
}

.featherlight .featherlight-content {
    width: 95%;
    margin: 0;
    height: 95%;
    padding: 12px 12px 0;
}

.featherlight-content .wikitext-featherlight {
    height: calc(100% - 48px);
}

.wikitext-featherlight h3,
.featherlight-content .full-screen {
    display: none;
    position: relative;
}

.wikitext-featherlight h3:after {
    content: "";
    position: absolute;
    top: -12px;
    right: -12px;
    left: -12px;
    bottom: -12px;
    background-color: rgba(0,0,0,.08);
}

.featherlight-content .wikitext-featherlight h3 {
    display: block;
    font-size: 16px;
    line-height: 24px;
}

button.featherlight-close-icon.featherlight-close {
    border: 0;
    box-shadow: none;
    background-color: transparent;
    width: 36px;
    height: 36px;
    line-height: 36px;
    margin: 6px 6px 0;
}

.featherlight-content .horizontal .wikitext-flex {
    height: calc(100% - 54px);
}

.featherlight-content .horizontal .wikitext-flex .textarea-flex,
.featherlight-content .horizontal .wikitext-flex .panzoom-container {
    min-height: 100%;
}

button.full-screen {
    margin: 0 24px 0 0;
}

button.full-screen:after {
    content: "\f24d";
    font-family: "Font Awesome 5 Free";
    display: inline-block;
    margin-left: 6px;
}

.current-previous {
    margin-right: 6px;
}

.from-revision,
.to-revision {
    width: 1em;
    margin: 0 6px;
}

#page-action-menu {
    display: inline-block;
    position: relative;
}

#page-action-menu ul {
    display: none;
    list-style: none;
    border: 1px solid #dfdfdf;
    background-color: #fff;
    border-radius: 3px;
    text-align: left;
    padding: 0;
    position: relative;
    box-shadow: 0 0 5px #dfdfdf;
    position: absolute;
    right: 0;
    width: auto;
    white-space: nowrap;
    margin: 12px 0;
}

#page-action-menu ul:before {
    content: "";
    position: absolute;
    bottom: calc(100% - 1px);
    right: 12px;
    width: 0;
    height: 0;
    border-bottom: 12px solid #fff;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
}

#page-action-menu ul:after {
    content: "";
    position: absolute;
    bottom: calc(100% - 1px);
    right: 11px;
    width: 0;
    height: 0;
    border-bottom: 14px solid #dfdfdf;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    z-index: -1;
}

#page-action-menu ul a,
#page-action-menu ul .inactive {
    padding: 6px 12px 5px;
    display: block;
    position: relative;
}

#page-action-menu ul .inactive {
    color: #dfdfdf;
}

#page-action-menu ul a:hover:before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #dfdfdf;
}

#page-action-menu ul li:not(:last-child) a,
#page-action-menu ul li:not(:last-child) span {
    border-bottom: 1px solid #dfdfdf;
}

#page-action-menu .expand:after {
    content: "\f0d7";
}

#page-action-menu .expand:after,
#page-action-menu .collapse:after {
    margin-left: 6px;
}

#page-action-menu .collapse + .collapsible {
    overflow: visible;
    display: block;
}

.breadcrumbs > *:not(:last-child):after {
    content: none;
}

.breadcrumbs .separator {
    display: inline-block;
    margin: 0 6px;
    color: #000;
}

.breadcrumbs .separator:after {
    content: "\f0da";
    font-family: "Font Awesome 5 Free";
    margin: 0;
    font-weight: 900;
}

#compare-table th {
    border-bottom: 1px solid #dfdfdf;
}

#compare-table td {
    position: relative;
}

#compare-table [colspan="2"],
#compare-table td.diff-context:nth-child(2) {
    border-right: 1px solid #dfdfdf;
}

#compare-table .diff-marker {
    width: 36px;
    vertical-align: top;
    text-align: center;
}

#compare-table col.diff-context {
    border-right: 1px solid #dfdfdf;
}

#compare-table .diff-addedline {
    background-color: #cdffcd;
    color: green;
}

#compare-table .diff-deletedline {
    color: #A91919;
    background-color: #fcc;
}

#compare-table .diff-deletedline div:before,
#compare-table .diff-addedline div:before {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 100%;
    width: 36px;
    text-align: center;
    line-height: 36px;
    font-weight: bold;
}

#compare-table .diff-addedline div:before {
    content: "+";
    background-color: #cdffcd;
}

#compare-table .diff-deletedline div:before {
    content: "-";
    background-color: #fcc;
}

#compare-table ins.diffchange:empty,
#compare-table del.diffchange:empty {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

#compare-table ins.diffchange:empty {
    background-color: #0080004f;
}


#compare-table del.diffchange:empty {
    background-color: #ff000061;
}

.parsed-comment {
    font-style: italic;
}

.watchlist.button,
.watchlist.button:hover {
    background-color: transparent;
    box-shadow: none !important;
}

.watchlist.button:before {
    content: "\f005";
    font-family: "Font Awesome 5 Free";
    font-weight: regular;
}

.watched.watchlist.button:before {
    font-weight: 900;
}

#reviewer-form .pagination {
    margin: 0;
    padding: 0;
    border-bottom: 0;
    float: right;
    width: auto;
}

#reviewer-form .revision h3 {
    margin-bottom: 0;
}

#reviewer-form .pagination .next.button {
    margin-right: -1px;
    border-radius: 0;
}

#reviewer-form .pagination .last.button {
    border-radius: 0 3px 3px 0;
}

#reviewer-form .field {
    display: flex;
    flex-wrap: wrap;
    border-bottom: 1px solid #dfdfdf;
    padding-bottom: 12px;
    margin-bottom: 12px;
    align-items: center;
}

#reviewer-form .field:last-child {
    border-bottom: 0;
}

#reviewer-form .value .field {
    border-bottom: 0;
    padding-bottom: 0;
    margin: 6px 0 0 0;
}

#reviewer-form label {
    width: calc(100% - 2em);
    margin-bottom: 0;
    padding-bottom: 0;
}

#reviewer-form label:after {
    content: none;
}

#reviewer-form select {
    margin-top: 6px;
}

#reviewer-form select[name="protection_expiry"] {
    display: none;
}

#reviewer-form img {
    display: none;
}

#approval-history table,
#completion-history table {
    background-color: #fff;
}

/* Login bar */

#scripto-login {
    display: flex;
    font-size: 14px;
    line-height: 21px;
    background-color: #0000000a;
    border-radius: 3px;
    padding: 6px;
    margin: 0 0 12px;
    align-items: center;
    justify-content: flex-end;
}

#scripto-login h3,
#scripto-login input,
#scripto-login button {
    font-size: 14px;
    line-height: 21px;
    margin: 0;
}

#scripto-login h3 {
    margin-right: auto;
}

#scripto-login input,
#scripto-login button {
    padding: 0 6px;
    height: 21px;
    min-height: 0;
}

#scripto-login .field {
    display: inline-flex;
    background: transparent;
    align-items: center;
    width: auto;
    padding: 0;
    margin: 0 12px 0 0;
}

#scripto-login .field-meta,
#scripto-login .inputs {
    padding: 0;
    line-height: 21px;
    width: auto;
}

#scripto-login .field-meta {
    text-align: right;
}

#scripto-login label {
    padding: 0 6px 0 0;
    max-width: none;
}

/* Dashboard */

.scripto.dashboard .dashboard-row {
    columns: 2;
}

.scripto.dashboard .panel {
    border: 1px solid #dfdfdf;
    border-radius: 3px;
    margin: 0 0 12px;
    width: 100%;
    padding: 0;
    float: none;
    page-break-inside: avoid;
    display: inline-block;
}

.scripto.dashboard .panel .button {
    min-height: 0;
    padding: 0 6px;
    font-size: 14px;
    margin: 0;
    font-weight: normal;
}

.scripto.dashboard .panel ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.scripto.dashboard .panel h4 {
    background-color: rgba(0,0,0,.04);
}

.scripto.dashboard .panel li,
.scripto.dashboard .panel h4,
.scripto.dashboard .panel p {
    padding: 6px 6px 5px;
    margin: 0;
}

.scripto.dashboard .panel h4,
.scripto.dashboard .panel li:not(:last-child) {
    border-bottom: 1px solid #dfdfdf;
}

/* User/browse */

.scripto.user.browse td {
    vertical-align: top;
}

.scripto.user.browse td:first-child, 
.scripto.user.browse th:first-child {
    width: auto;
}

.scripto.user.browse .tablesaw-cell-content {
    flex-wrap: wrap;
}

/* Sidebar */

body.sidebar-open #content.expanded {
    width: calc(81.25% - 12px);
}

.sidebar.always-open {
    padding-left: 23px;
}

.sidebar.always-open.collapsed {
    left: 100%;
}

button.sidebar-drawer {
    position: fixed;
    top: 48px;
    left: 75%;
    bottom: -12px;
    width: 12px;
    padding: 0;
    border-radius: 0;
    background-color: #f7f7f7;
    box-shadow: none;
    border-right: 1px solid #dfdfdf;
    border-left: 1px solid #dfdfdf;
    transition: left .5s;
    z-index: 1;
}

button.sidebar-drawer.expand {
    left: calc(100% - 12px);
}

button.sidebar-drawer:hover {
    box-shadow: none;
}

button.sidebar-drawer:after {
    color: #676767;
    font-size: 12px;
    text-align: center;
    margin-left: 0;
}

button.sidebar-drawer.expand:after {
    content: "\f104";
}

button.sidebar-drawer.collapse:after {
    content: "\f105";
}