/* Safe saving (js/safe_save.js, widgets/save_status.html): the "Saved" line, the warning when someone else saved the
   passage meanwhile, the unsaved-draft offer, and History's restore buttons. Both looks: the classic colours
   (bblue-500 brown, bred-500 maroon, public-500 green), in the page's own type (Montserrat in the classic look,
   Source Sans 3 in the new one). Hand-written, like next.css: no Tailwind rebuild. */
.safe-save { font-size: .875rem; line-height: 1.25rem; color: #1f2937; }
.safe-save .hidden, .safe-save-banner.hidden { display: none; }
.safe-save-status, .safe-save-conflict, .safe-save-draft {
    margin: .25rem .75rem; padding: .375rem .75rem; border-radius: .375rem; border-left: 4px solid;
}
.safe-save-status { border-color: rgb(155 115 58); background: rgb(155 115 58 / .08); }
.safe-save-status.is-saved { border-color: #05a36a; background: rgb(5 163 106 / .08); }
.safe-save-status.is-error { border-color: #830B0C; background: rgb(131 11 12 / .07); }
.safe-save-tick { color: #05a36a; font-weight: 700; margin-right: .25rem; }
.safe-save-conflict { border-color: #830B0C; background: rgb(131 11 12 / .06); }
.safe-save-conflict strong { color: #830B0C; }
.safe-save-draft { border-color: rgb(155 115 58); background: rgb(155 115 58 / .1);
    display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; }
.safe-save-actions { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: .375rem; }
.safe-save-draft .safe-save-actions { margin-top: 0; }
.safe-save-actions button {
    padding: .125rem .75rem; border-radius: 9999px; border: 1px solid rgb(155 115 58);
    background: #fff; color: rgb(110 80 38); font-weight: 600; cursor: pointer;
}
.safe-save-actions button[data-safe-save-action="overwrite"],
.safe-save-actions button[data-safe-save-action="restore-draft"] { background: rgb(155 115 58); color: #fff; }
.safe-save-actions button:focus-visible { outline: 2px solid #830B0C; outline-offset: 2px; }
@media (hover: hover) {
    .safe-save-actions button:hover { background: rgb(155 115 58 / .15); }
    .safe-save-actions button[data-safe-save-action="overwrite"]:hover,
    .safe-save-actions button[data-safe-save-action="restore-draft"]:hover { background: rgb(132 98 49); }
}
.safe-save-note { color: #4b5563; font-size: .8125rem; margin-top: .25rem; }
.safe-save-compare { margin-top: .5rem; }
.safe-save-compare [data-safe-save-diff] {
    max-height: 12em; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
    background: #fff; border: 1px solid #e5e7eb; border-radius: .25rem; padding: .375rem .5rem; margin-top: .25rem;
}
.safe-save ins, .safe-save-compare ins { background: #bbf7d0; color: #14532d; text-decoration: none; font-weight: 600; }
.safe-save del, .safe-save-compare del { background: #fecaca; color: #7f1d1d; text-decoration: line-through; }
html[data-ui="next"] .safe-save-compare [data-safe-save-diff] { font-family: var(--font-read); font-size: 1rem; }
@media (max-height: 800px) {   /* a 1366x768 laptop, a phone: Compare leaves room for the editor's box */
    .safe-save-compare [data-safe-save-diff] { max-height: 7em; }
}
@media (pointer: coarse) {
    .safe-save-actions button { min-height: 2.25rem; padding: .25rem .875rem; }
}
/* Room for the editor's box (.safe-save-room: the viewer's #transcribe_texts, Manage's box). The pane does not
   scroll and the box used to shrink to make room, so on a short pane (a 1366x768 laptop, a phone) the warning, with
   Compare open, squeezed it to nothing. While the panel shows something, the box keeps about eight lines and the
   form scrolls instead. With no message the layout is as before. The second pair is for browsers without :has()
   (a conflict is marked on the form by the server). By the forms' ids: next.css sizes Manage's box with an id
   selector (#text_manage > form > .h-full.overflow-y-auto), which a class selector would not outweigh. */
:is(#transcription_form, #transcribe-form)[data-safe-save="on"]:has([data-safe-save-panel] > :not(.hidden)) {
    overflow-y: auto; }
:is(#transcription_form, #transcribe-form)[data-safe-save="on"]:has([data-safe-save-panel] > :not(.hidden)) .safe-save-room {
    min-height: 11rem; }
:is(#transcription_form, #transcribe-form)[data-safe-save="on"][data-save-status="conflict"] { overflow-y: auto; }
:is(#transcription_form, #transcribe-form)[data-safe-save="on"][data-save-status="conflict"] .safe-save-room.safe-save-room {
    min-height: 11rem; }
/* (and a text with a character the database cannot store: "invalid", the fix bundle) */
:is(#transcription_form, #transcribe-form)[data-safe-save="on"][data-save-status="invalid"] { overflow-y: auto; }
:is(#transcription_form, #transcribe-form)[data-safe-save="on"][data-save-status="invalid"] .safe-save-room.safe-save-room {
    min-height: 11rem; }
/* read out by screen readers only (js/safe_save.js announce) */
.safe-save-sr {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* History */
.safe-save-back { margin: 0 0 .5rem; }
.safe-save-back a, .safe-save-banner a, .safe-save-note a { color: rgb(155 115 58); text-decoration: underline; }
.safe-save-banner { margin: 0 0 .75rem; font-size: .9375rem; }
.safe-save-row-head { flex-wrap: wrap; align-items: center; justify-content: flex-end; row-gap: .375rem; }
.safe-save-restore { display: inline; margin: 0; }
.safe-save-badge {
    font-style: normal; font-size: .8125rem; font-weight: 600; color: #047857;
    border: 1px solid #05a36a; border-radius: 9999px; padding: 0 .5rem;
}
.safe-save-row-foot { margin-top: .5rem; display: flex; justify-content: flex-end; }
@media (max-width: 639px) {
    #transcription_history > .px-10 { padding-left: .75rem; padding-right: .75rem; }   /* 2.5rem each side on a phone */
    .safe-save-row-head { justify-content: flex-start; }
    .safe-save-row-head > button.mx-4 { margin-left: .5rem; margin-right: .5rem; }
    .safe-save-row-head > div { flex-basis: 100%; }
}
@media (pointer: coarse) {
    .safe-save-restore button, .safe-save-row-head > button { min-height: 2.25rem; }
}
