/*
 * Admin tweaks, loaded by settings.UNFOLD["STYLES"].
 *
 * Two blocks of text Unfold has no opinion about, because no ordinary Django
 * project has them: the license token and the raw webhook payload. Both are
 * long, both get read character by character, and both get copied out into
 * support replies — so the only things styled here are wrapping, selection and
 * a monospace face. Everything else is left to the theme.
 */

code.license-token,
pre.json-payload {
    display: block;
    margin: 0;
    padding: 0.75rem 0.875rem;
    border: 1px solid rgb(228 230 235);
    border-radius: 0.375rem;
    background-color: rgb(246 247 249);
    color: rgb(30 41 68);
    font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.75rem;
    line-height: 1.6;
}

code.license-token {
    /*
     * The token is one unbroken base64 run with a single dot in it. Without
     * `anywhere` it either overflows its column or forces the whole change
     * form to scroll sideways; `pre-wrap` keeps the wrap purely visual, so a
     * copy never picks up a line break that would break the signature.
     */
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    /* One click selects the whole key — no dragging to the end of a wrap. */
    user-select: all;
    letter-spacing: 0.01em;
}

pre.json-payload {
    max-height: 32rem;
    overflow: auto;
    white-space: pre;
}

/* Unfold puts `class="dark"` on <html>, so this is all the dark theme needs. */
.dark code.license-token,
.dark pre.json-payload {
    border-color: rgb(45 50 61);
    background-color: rgb(24 27 34);
    color: rgb(212 216 224);
}
