/* ============================================================================
 * Post editor chrome
 *
 * Everything the editor puts *around* the article: the toolbar and its menus,
 * the settings window, the image editor, the statistics panel, the link
 * popover, the block affordances.
 *
 * The pieces used to be styled in five different places — a <style> block built
 * by posteditor.js, editor.css, PostSettingsElement.css, an inline <style> in
 * post-statistics.html and a pile of style="" attributes in the JS that builds
 * the panels — and each had picked its own palette, radius and shadow. This is
 * the one place that decides how editor chrome looks.
 *
 * The tokens below are deliberately the admin panel's (AdminPage.css) and the
 * account menu's (masthead.css) values, so a user moving between the dashboard
 * and the editor sees one product rather than two.
 * ========================================================================= */

/* <editor-fold desc="Tokens"> */

:root {
    /* Surfaces */
    --ed-bg: #f1f5f9;
    --ed-surface: #ffffff;
    --ed-surface-sunken: #f8fafc;
    --ed-surface-hover: #f1f5f9;

    /* Lines and text */
    --ed-border: #e2e8f0;
    --ed-border-strong: #cbd5e1;
    --ed-text: #0f172a;
    --ed-text-muted: var(--color-muted-strong, #64748b);
    --ed-text-faint: var(--color-muted, #94a3b8);

    /* Accents. The deep tone is the site's navy, used for headers and the
       active tab; the accent is the lighter blue used for interactive state. */
    --ed-accent: var(--color-secondary, #1c6bb1);
    --ed-accent-deep: var(--color-primary, #003657);
    --ed-danger: #be3927;
    --ed-success: #15803d;
    --ed-warning: #b45309;

    /* Elevation */
    --ed-shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
    --ed-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
    --ed-shadow-md: 0 8px 24px rgba(15, 23, 42, 0.12), 0 2px 6px rgba(15, 23, 42, 0.05);
    --ed-shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.22), 0 4px 12px rgba(15, 23, 42, 0.08);

    /* Geometry */
    --ed-radius-sm: 6px;
    --ed-radius: 10px;
    --ed-radius-lg: 14px;

    --ed-toolbar-height: 44px;

    /* Typography. The site's display face is Ubuntu; editor chrome is UI text
       and reads better in the system stack at these sizes. */
    --ed-font: "Ubuntu", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* </editor-fold> */

/* <editor-fold desc="Shared primitives"> */

/* Focus ring. Every interactive element in the editor chrome uses this one, so
   keyboard users get a consistent target instead of the browser default in some
   places and nothing at all in others. */
.ed-toolbar :focus-visible,
.ed-menu :focus-visible,
.ed-panel :focus-visible,
.window .ed-field :focus-visible,
.ed-segment :focus-visible {
    outline: 2px solid var(--ed-accent);
    outline-offset: 2px;
    border-radius: var(--ed-radius-sm);
}

/* ── The writing surface keeps no ring ────────────────────────────────
 * The site-wide `:focus-visible { outline: 3px solid var(--color-link) }` in
 * /css/style.css scores (0,1,0) — an exact tie with EditorJS's own
 * `.ce-paragraph { outline: none }` and `.cdx-input { outline: none }` — and
 * editorjs.js injects its stylesheet from JavaScript while common-includes.html
 * is still parsing, so style.css's <link> comes later and the tie broke its way.
 * The result was a 3px ring around whichever text block held the caret, on every
 * click and every keystroke: both Chrome and Firefox match :focus-visible on a
 * contenteditable however focus was gained, so it was not even limited to the
 * keyboard. Inside a block the caret *is* the focus indicator, which is what the
 * `outline: none` was saying.
 *
 * This restores it at a weight the global rule cannot tie with, rather than
 * lowering the global rule — the same tie-plus-document-order mechanism is what
 * makes that rule beat the `outline: none` in collapsible.css, which is wanted.
 * Scoped to #postContent, the EditorJS holder, so it reaches the blocks and
 * nothing else: the toolbar, the menus and the settings windows above still get
 * their rings, and on the public /post route the blocks are read-only and not
 * focusable at all, so nothing there changes either way.
 */
#postContent [contenteditable]:focus-visible,
#postContent .cdx-input:focus-visible {
    outline: none;
}

/* The block picker's search field, same story — a borderless transparent input,
   ringed the moment the picker opened. Doubled rather than scoped, because
   EditorJS moves the popover to <body> while it measures itself. */
.cdx-search-field__input.cdx-search-field__input:focus-visible {
    outline: none;
}

/* ── Buttons ──────────────────────────────────────────────────────────
 * Button.css paints every <button> on the site as a 43px navy pill with a
 * sweeping highlight, which is right for a page call-to-action and wrong for a
 * settings row. These are the editor's own, and they have to out-specify that
 * rule (0,2,1) — hence the doubled class.
 */
.ed-btn.ed-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    box-sizing: border-box;
    height: 36px;
    padding: 0 14px;
    margin: 0;

    border: 1px solid var(--ed-border-strong);
    border-radius: var(--ed-radius-sm);

    background-color: var(--ed-surface);
    color: var(--ed-text);

    font-family: var(--ed-font);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;

    cursor: pointer;
    overflow: hidden;
    filter: none;

    transition: background-color 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

/* Kills the sweeping white bar the global rule adds to every button. */
.ed-btn.ed-btn::after {
    content: none;
}

.ed-btn.ed-btn:hover {
    background-color: var(--ed-surface-hover);
    border-color: var(--ed-border-strong);
    filter: none;
}

.ed-btn.ed-btn:active {
    background-color: #e8eef4;
}

.ed-btn.ed-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: none !important;
}

.ed-btn--primary.ed-btn--primary {
    background-color: var(--ed-accent);
    border-color: var(--ed-accent);
    color: #ffffff;
}

.ed-btn--primary.ed-btn--primary:hover {
    background-color: var(--ed-accent-deep);
    border-color: var(--ed-accent-deep);
}

.ed-btn--danger.ed-btn--danger {
    color: var(--ed-danger);
    border-color: color-mix(in srgb, var(--ed-danger) 35%, var(--ed-surface));
}

.ed-btn--danger.ed-btn--danger:hover {
    background-color: color-mix(in srgb, var(--ed-danger) 8%, var(--ed-surface));
}

.ed-btn--ghost.ed-btn--ghost {
    background-color: transparent;
    border-color: transparent;
}

.ed-btn--ghost.ed-btn--ghost:hover {
    background-color: var(--ed-surface-hover);
}

.ed-btn--sm.ed-btn--sm {
    height: 30px;
    padding: 0 10px;
    font-size: 12.5px;
}

.ed-btn--icon.ed-btn--icon {
    width: 36px;
    padding: 0;
}

.ed-btn--icon.ed-btn--sm.ed-btn--sm {
    width: 30px;
}

/* ── Segmented control ────────────────────────────────────────────────
 * Replaces the rows of blue pills the image editor used for "cover / contain /
 * fill / scale-down" and the width presets, where nothing indicated which one
 * was in effect.
 */
.ed-segment {
    display: inline-flex;
    padding: 3px;
    gap: 2px;

    background-color: var(--ed-surface-sunken);
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius-sm);
}

.ed-segment--block {
    display: flex;
    width: 100%;
}

.ed-segment > button.ed-segment-option {
    flex: 1;

    height: 30px;
    min-width: 44px;
    padding: 0 12px;
    margin: 0;

    border: 0;
    border-radius: 4px;

    background-color: transparent;
    color: var(--ed-text-muted);

    font-family: var(--ed-font);
    font-size: 12.5px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;

    cursor: pointer;
    overflow: hidden;
    filter: none;

    transition: background-color 0.14s ease, color 0.14s ease;
}

.ed-segment > button.ed-segment-option::after {
    content: none;
}

.ed-segment > button.ed-segment-option:hover {
    color: var(--ed-text);
    background-color: rgba(15, 23, 42, 0.04);
    filter: none;
}

.ed-segment > button.ed-segment-option[aria-pressed="true"],
.ed-segment > button.ed-segment-option[aria-checked="true"] {
    background-color: var(--ed-surface);
    color: var(--ed-accent-deep);
    box-shadow: var(--ed-shadow-sm);
}

/* ── Fields ───────────────────────────────────────────────────────────── */

.ed-field {
    box-sizing: border-box;
    width: 100%;
    min-height: 36px;
    padding: 8px 11px;

    border: 1px solid var(--ed-border-strong);
    border-radius: var(--ed-radius-sm);

    background-color: var(--ed-surface);
    color: var(--ed-text);

    font-family: var(--ed-font);
    font-size: 13.5px;
    line-height: 1.4;

    transition: border-color 0.14s ease, box-shadow 0.14s ease;
}

.ed-field::placeholder {
    color: var(--ed-text-faint);
}

.ed-field:focus {
    outline: none;
    border-color: var(--ed-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ed-accent) 16%, transparent);
}

.ed-field:disabled {
    background-color: var(--ed-surface-sunken);
    color: var(--ed-text-faint);
    cursor: not-allowed;
}

.ed-field--invalid,
.ed-field--invalid:focus {
    border-color: var(--ed-danger);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ed-danger) 14%, transparent);
}

textarea.ed-field {
    min-height: 96px;
    resize: vertical;
}

select.ed-field {
    /* The UA arrow sits on a different baseline in every browser; this is the
       same chevron the account menu uses, drawn into the padding box. */
    -webkit-appearance: none;
    appearance: none;
    padding-right: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5 8 10.5 12 6.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 14px 14px;
    cursor: pointer;
}

.ed-field-hint {
    display: block;
    margin-top: 5px;
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--ed-text-faint);
}

.ed-field-hint--error {
    color: var(--ed-danger);
}

/* ── Empty state ──────────────────────────────────────────────────────── */

.ed-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 34px 20px;

    color: var(--ed-text-faint);
    text-align: center;
}

.ed-empty > i {
    font-size: 26px;
    opacity: 0.55;
}

.ed-empty > span {
    font-size: 13px;
    max-width: 34ch;
    line-height: 1.5;
}

/* </editor-fold> */

/* <editor-fold desc="Title and subtitle placeholders"> */

/* posteditor.js used to build these rules as a <style> element and append it to
 * <head> on construction. They are scoped to [contenteditable] instead of to the
 * ids alone, because PostPage.js only makes the two headings editable on the
 * /editor route — on a published post the placeholder would otherwise flash
 * before the real title arrives from the API.
 */
#postTitle[contenteditable]:empty:not(:focus)::before,
#postTitle[contenteditable]:has(br:only-child):not(:focus)::before {
    content: "Title…";
    opacity: 0.4;
    pointer-events: none;
}

#postSubtitle[contenteditable]:empty:not(:focus)::before,
#postSubtitle[contenteditable]:has(br:only-child):not(:focus)::before {
    content: "Subtitle…";
    opacity: 0.3;
    pointer-events: none;
}

/* A visible edge on the two fields that are not part of the block editor and so
   get none of its affordances. */
#postTitle[contenteditable],
#postSubtitle[contenteditable] {
    border-radius: var(--ed-radius-sm);
    outline: none !important;
    transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

#postTitle[contenteditable]:hover,
#postSubtitle[contenteditable]:hover {
    background-color: rgba(15, 23, 42, 0.03);
    box-shadow: 0 0 0 6px rgba(15, 23, 42, 0.03);
}

#postTitle[contenteditable]:focus,
#postSubtitle[contenteditable]:focus {
    background-color: color-mix(in srgb, var(--ed-accent) 6%, transparent);
    box-shadow: 0 0 0 6px color-mix(in srgb, var(--ed-accent) 6%, transparent);
}

/* </editor-fold> */

/* <editor-fold desc="Toolbar"> */

#posteditorToolbar {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 120;

    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 8px;

    /* Was `height: 3vh`, so the bar was 19px tall on a laptop and its labels
       overflowed it. */
    height: var(--ed-toolbar-height);
    width: 100%;
    padding: 0 12px;

    background-color: var(--ed-surface);
    border-bottom: 1px solid var(--ed-border);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.07);

    font-family: var(--ed-font);
    color: var(--ed-text);
}

/* ── Menu bar ─────────────────────────────────────────────────────────── */

.ed-menubar {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: none;
}

#posteditorToolbar button.ed-menubar-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    height: 30px;
    width: auto;
    padding: 0 11px;
    margin: 0;

    border: 0;
    border-radius: var(--ed-radius-sm);

    background-color: transparent;
    color: var(--ed-text);

    font-family: var(--ed-font);
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1;

    cursor: pointer;
    overflow: hidden;
    filter: none;

    transition: background-color 0.12s ease, color 0.12s ease;
}

#posteditorToolbar button.ed-menubar-item::after {
    content: none;
}

#posteditorToolbar button.ed-menubar-item:hover {
    background-color: var(--ed-surface-hover);
    filter: none;
}

#posteditorToolbar button.ed-menubar-item[aria-expanded="true"] {
    background-color: color-mix(in srgb, var(--ed-accent) 12%, var(--ed-surface));
    color: var(--ed-accent-deep);
}

/* ── Divider and title ────────────────────────────────────────────────── */

.ed-toolbar-divider {
    flex: none;
    width: 1px;
    height: 20px;
    margin: 0 4px;
    background-color: var(--ed-border);
}

.ed-toolbar-title {
    flex: 1 1 auto;
    min-width: 0;

    display: flex;
    align-items: baseline;
    gap: 8px;

    font-size: 13px;
    color: var(--ed-text-muted);
}

.ed-toolbar-title > .ed-toolbar-title-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 600;
    color: var(--ed-text);
}

.ed-toolbar-title > .ed-toolbar-title-id {
    flex: none;
    font-size: 11.5px;
    color: var(--ed-text-faint);
    font-variant-numeric: tabular-nums;
}

/* ── Quick actions ────────────────────────────────────────────────────── */

.ed-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: none;

    /* The title is what pushes this to the right edge, and it is dropped below
       900px — without this the actions bunched up against the menu bar with the
       rest of the toolbar empty. */
    margin-left: auto;
}

/* ── Status chips ─────────────────────────────────────────────────────── */

.ed-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    height: 26px;
    padding: 0 10px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;

    background-color: var(--ed-surface-sunken);
    color: var(--ed-text-muted);
    border: 1px solid var(--ed-border);
}

.ed-chip > i {
    font-size: 11px;
}

.ed-chip[data-state="secure"] {
    background-color: color-mix(in srgb, var(--ed-success) 10%, var(--ed-surface));
    border-color: color-mix(in srgb, var(--ed-success) 28%, var(--ed-surface));
    color: var(--ed-success);
}

.ed-chip[data-state="warning"] {
    background-color: color-mix(in srgb, var(--ed-warning) 12%, var(--ed-surface));
    border-color: color-mix(in srgb, var(--ed-warning) 32%, var(--ed-surface));
    color: var(--ed-warning);
}

.ed-chip[data-state="broken"] {
    background-color: color-mix(in srgb, var(--ed-danger) 10%, var(--ed-surface));
    border-color: color-mix(in srgb, var(--ed-danger) 30%, var(--ed-surface));
    color: var(--ed-danger);
}

/* The lock chip replaced a 50px circle floating over the bottom-right corner of
   the article. The pulse is kept — it is the only sign the heartbeat is alive —
   but as a ring on the icon rather than a bounce of the whole element. */
@keyframes edChipPulse {
    0% { box-shadow: 0 0 0 0 currentColor; opacity: 0.55; }
    70% { box-shadow: 0 0 0 5px transparent; opacity: 0; }
    100% { box-shadow: 0 0 0 0 transparent; opacity: 0; }
}

.ed-chip > .ed-chip-pulse {
    display: inline-block;
    height: 6px;
    width: 6px;
    border-radius: 50%;
    background-color: currentColor;
    opacity: 0.55;
}

.ed-chip.is-pulsing > .ed-chip-pulse {
    animation: edChipPulse 1s ease-out;
}

/* Hides the labels before the bar gets crowded, rather than letting the title
   and the chips collide. */
@media (max-width: 900px) {
    .ed-toolbar-title,
    .ed-toolbar-action-label {
        display: none;
    }
}

@media (max-width: 620px) {
    .ed-chip > span:not(.ed-chip-pulse) {
        display: none;
    }

    .ed-chip {
        padding: 0 8px;
    }
}

/* </editor-fold> */

/* <editor-fold desc="Menus"> */

/* Deliberately the account menu's shape (masthead.css): same radius, border,
   shadow, row height and hover tint. The two menus sit 40px apart on screen. */
.ed-menu {
    position: fixed;
    z-index: 1000;

    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 3px;

    min-width: 232px;
    max-width: min(320px, calc(100vw - 24px));
    padding: 6px;

    background-color: var(--ed-surface);
    color: var(--ed-text);

    border: 1px solid rgba(15, 23, 42, 0.09);
    border-radius: var(--ed-radius-lg);
    box-shadow:
        0 12px 32px rgba(15, 23, 42, 0.16),
        0 2px 6px rgba(15, 23, 42, 0.06);

    font-family: var(--ed-font);

    transform-origin: top left;
    transform: translateY(-6px) scale(0.97);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 0.16s ease,
        transform 0.16s cubic-bezier(0.16, 1, 0.3, 1);
}

/* The UA sheet's [hidden] rule loses to the display above. */
.ed-menu[hidden] {
    display: none;
}

.ed-menu.is-open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
}

.ed-menu-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.ed-menu-label {
    padding: 7px 10px 4px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ed-text-faint);
}

.ed-menu button.ed-menu-item,
.ed-menu a.ed-menu-item {
    position: relative;

    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;

    box-sizing: border-box;
    width: 100%;
    height: 38px;
    padding: 0 10px;
    margin: 0;

    border: 0;
    border-radius: 8px;

    background-color: transparent;
    color: var(--ed-text);

    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;

    cursor: pointer;
    overflow: hidden;
    filter: none;

    transition: background-color 0.12s ease, color 0.12s ease;
}

.ed-menu button.ed-menu-item::after {
    content: none;
}

.ed-menu .ed-menu-item > i {
    justify-self: center;
    font-size: 14px;
    color: var(--ed-text-muted);
    transition: color 0.12s ease;
}

.ed-menu .ed-menu-item > span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.ed-menu .ed-menu-item > kbd {
    justify-self: end;

    padding: 2px 6px;

    border: 1px solid var(--ed-border);
    border-radius: 5px;

    background-color: var(--ed-surface-sunken);
    color: var(--ed-text-faint);

    font-family: var(--ed-font);
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
}

.ed-menu .ed-menu-item:hover,
.ed-menu .ed-menu-item:focus-visible {
    background-color: color-mix(in srgb, var(--ed-accent) 10%, var(--ed-surface));
    color: var(--ed-accent);
    filter: none;
}

.ed-menu .ed-menu-item:hover > i,
.ed-menu .ed-menu-item:focus-visible > i {
    color: var(--ed-accent);
}

.ed-menu .ed-menu-item:focus-visible {
    outline: 2px solid var(--ed-accent);
    outline-offset: -2px;
}

.ed-menu .ed-menu-item:active {
    background-color: color-mix(in srgb, var(--ed-accent) 16%, var(--ed-surface));
}

.ed-menu .ed-menu-item[aria-disabled="true"] {
    color: var(--ed-text-faint);
    cursor: default;
    pointer-events: none;
}

.ed-menu .ed-menu-item--danger,
.ed-menu .ed-menu-item--danger > i {
    color: var(--ed-danger);
}

.ed-menu .ed-menu-item--danger:hover,
.ed-menu .ed-menu-item--danger:focus-visible,
.ed-menu .ed-menu-item--danger:hover > i,
.ed-menu .ed-menu-item--danger:focus-visible > i {
    color: var(--ed-danger);
    background-color: color-mix(in srgb, var(--ed-danger) 10%, var(--ed-surface));
}

.ed-menu-separator {
    height: 1px;
    margin: 4px 8px;
    background-color: var(--ed-border);
}

@media (prefers-reduced-motion: reduce) {
    .ed-menu {
        transition: none;
        transform: none;
    }
}

/* </editor-fold> */

/* <editor-fold desc="Windows"> */

/* The base .window in Window.css is a 60vh box with a 5:3 aspect ratio and a
   position:fixed title bar. Editor windows opt into a flex column instead, which
   is what stops the tab strip and the panel from overlapping — the old rule gave
   the strip 25% and the panel `calc(75% - 25px)` *plus* 25px of padding on each
   side, so together they were wider than the window. */
.window.window--editor {
    height: min(78vh, 720px);
    width: min(94vw, 940px);
    aspect-ratio: unset;

    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;

    background-color: var(--ed-surface);
    border-radius: var(--ed-radius-lg);
    box-shadow: var(--ed-shadow-lg);
    filter: none;

    font-family: var(--ed-font);
    color: var(--ed-text);

    overflow: hidden;
}

.window.window--editor.window--editor-sm {
    height: auto;
    max-height: min(86vh, 720px);
    width: min(94vw, 560px);
}

.window.window--editor > .topbar {
    position: relative;
    top: 0;
    left: 0;

    flex: none;
    box-sizing: border-box;
    height: 46px;
    width: 100%;
    padding: 0 14px;

    background-color: var(--ed-accent-deep);
    color: #ffffff;

    display: flex;
    align-items: center;
    gap: 10px;
}

.window.window--editor > .topbar > .windowtitle {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.window.window--editor > .topbar > .popup-window-drag-icon {
    display: none;
}

.window.window--editor > .topbar > .popup-window-icon {
    font-size: 14px;
    opacity: 0.9;
}

.window.window--editor > .topbar > .closebutton,
.window.window--editor > .topbar > .infobutton {
    position: static;

    display: grid;
    place-items: center;

    height: 28px;
    width: 28px;

    border-radius: 7px;
    font-size: 14px;
    line-height: 1;

    opacity: 0.75;
    cursor: pointer;
    transition: background-color 0.14s ease, opacity 0.14s ease;
}

.window.window--editor > .topbar > .closebutton {
    margin-left: auto;
}

.window.window--editor > .topbar > .infobutton + .closebutton {
    margin-left: 0;
}

.window.window--editor > .topbar > .infobutton {
    margin-left: auto;
}

.window.window--editor > .topbar > .closebutton:hover,
.window.window--editor > .topbar > .infobutton:hover {
    background-color: rgba(255, 255, 255, 0.16);
    opacity: 1;
}

.window.window--editor > .topbar > .closebutton:focus-visible,
.window.window--editor > .topbar > .infobutton:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: -2px;
}

.window.window--editor > .content {
    position: relative;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;

    flex: 1 1 auto;
    min-height: 0;

    display: flex;
    flex-direction: row;
    background-color: var(--ed-surface);
}

/* ── Tab rail ─────────────────────────────────────────────────────────── */

/* A rail can hold more than the tab strip — the settings window puts a summary
   of the post above it, so which post is being configured is visible from every
   tab rather than only from the title bar. */
.window.window--editor .ed-rail {
    flex: none;
    box-sizing: border-box;
    width: 220px;

    /* Explicit: the settings window's container carries the legacy
       `.windowcontent` class, and `.window > .windowcontent > div` in Window.css
       still puts 25px of padding on every direct child. */
    padding: 0;

    display: flex;
    flex-direction: column;

    background-color: var(--ed-surface-sunken);
    border-right: 1px solid var(--ed-border);

    overflow-y: auto;
    overscroll-behavior: contain;
}

.window.window--editor .ed-rail > .window-tabs,
.window.window--editor .ed-rail > ul[role="tablist"] {
    width: 100% !important;
    border-right: 0;
    background-color: transparent;
    overflow: visible;
}

.window.window--editor .window-tabs,
.window.window--editor ul[role="tablist"] {
    flex: none;
    box-sizing: border-box;
    width: 196px !important;
    /* Window.css pins the strip to `calc(100% - 10px)`, which left a 10px strip
       of the panel's background showing under the rail. */
    height: auto;

    display: flex;
    flex-direction: column;
    gap: 2px;

    padding: 10px 8px;
    margin: 0;

    list-style: none;
    overflow-y: auto;

    background-color: var(--ed-surface-sunken);
    border-right: 1px solid var(--ed-border);
}

.window.window--editor .window-tabs > li,
.window.window--editor ul[role="tablist"] > li {
    width: 100%;
    background: none;
    border-radius: 0;
}

.window.window--editor .window-tabs > li:hover,
.window.window--editor ul[role="tablist"] > li:hover {
    background: none;
}

.window.window--editor .window-tabs > li > a,
.window.window--editor ul[role="tablist"] > li > a {
    display: flex;
    align-items: center;
    gap: 10px;

    box-sizing: border-box;
    width: 100%;
    padding: 9px 11px;

    border: 0;
    border-left: 0;
    border-radius: var(--ed-radius-sm);

    background-color: transparent;
    color: var(--ed-text-muted);

    font-family: var(--ed-font);
    font-size: 13.5px;
    font-weight: 600;
    text-align: left;
    text-decoration: none;

    transition: background-color 0.14s ease, color 0.14s ease;
}

.window.window--editor .window-tabs > li > a > i,
.window.window--editor ul[role="tablist"] > li > a > i {
    width: 16px;
    flex: none;
    font-size: 13px;
    text-align: center;
    opacity: 0.8;
}

.window.window--editor .window-tabs > li > a:hover,
.window.window--editor ul[role="tablist"] > li > a:hover {
    background-color: rgba(15, 23, 42, 0.045);
    color: var(--ed-text);
}

.window.window--editor .window-tabs > li > a[aria-selected="true"],
.window.window--editor ul[role="tablist"] > li > a[aria-selected="true"] {
    background-color: var(--ed-surface);
    color: var(--ed-accent-deep);
    box-shadow: var(--ed-shadow-sm);
    border-left-color: transparent;
}

/* ── Tab panels ───────────────────────────────────────────────────────── */

/* The second selector catches panels that do not carry the class — the image
   editor builds its own markup. `.ed-rail` has to be excluded explicitly or the
   settings window's rail is treated as a panel and grows to fill the window. */
.window.window--editor .window-tab,
.window.window--editor > .content > div:not(.window-tabs):not([role="tablist"]):not(.ed-rail) {
    flex: 1 1 auto;
    min-width: 0;
    width: auto !important;

    box-sizing: border-box;
    padding: 22px 24px 28px;

    overflow-y: auto;
    overscroll-behavior: contain;

    background-color: var(--ed-surface);
}

.window.window--editor .window-tab::-webkit-scrollbar,
.window.window--editor .window-tabs::-webkit-scrollbar {
    width: 8px;
}

.window.window--editor .window-tab::-webkit-scrollbar-thumb,
.window.window--editor .window-tabs::-webkit-scrollbar-thumb {
    background-color: rgba(15, 23, 42, 0.16);
    border-radius: 999px;
}

/* Tabby leaves the hidden panels in the flow with `display: none` on some
   builds and an [hidden] attribute on others; both have to lose to the flex
   rule above only when the panel is the selected one. */
.window.window--editor .window-tab[hidden] {
    display: none;
}

/* ── Panel furniture ──────────────────────────────────────────────────── */

.ed-panel-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;

    margin: 0 0 18px;
}

.ed-panel-header h2 {
    margin: 0;

    font-family: var(--ed-font);
    font-size: 17px;
    font-weight: 700;
    line-height: 1.25;
    color: var(--ed-text);
}

.ed-panel-header p {
    margin: 5px 0 0;
    max-width: 62ch;

    font-size: 12.5px;
    line-height: 1.5;
    color: var(--ed-text-muted);
}

.ed-panel-header-actions {
    flex: none;
    display: flex;
    gap: 8px;
}

/* A card is the unit every settings panel is built from — one concern each,
   rather than the single boxed .form-group that wrapped whole tabs. */
.ed-card {
    margin-bottom: 16px;
    padding: 16px;

    background-color: var(--ed-surface);
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    box-shadow: var(--ed-shadow-sm);
}

.ed-card--flush {
    padding: 0;
    overflow: hidden;
}

.ed-card-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    margin: 0 0 4px;

    font-size: 13.5px;
    font-weight: 700;
    color: var(--ed-text);
}

.ed-card-description {
    margin: 0 0 14px;
    max-width: 64ch;

    font-size: 12.5px;
    line-height: 1.5;
    color: var(--ed-text-muted);
}

.ed-card-description:last-child {
    margin-bottom: 0;
}

/* One labelled setting. Replaces .settings-entry, whose `max-width: 65%` label
   and free-floating control produced the ragged two-column layout in the
   screenshots. */
.ed-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px 20px;

    padding: 13px 0;
    border-top: 1px solid var(--ed-border);
}

.ed-row:first-of-type {
    border-top: 0;
    padding-top: 4px;
}

.ed-row:last-of-type {
    padding-bottom: 2px;
}

/* For controls that need the full width under their label (map, textarea). */
.ed-row--stacked {
    grid-template-columns: minmax(0, 1fr);
}

.ed-row--top {
    align-items: start;
}

.ed-row-label {
    min-width: 0;
}

.ed-row-label > label,
.ed-row-label > .ed-row-label-text {
    display: block;

    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--ed-text);
}

.ed-row-label > small {
    display: block;
    margin-top: 3px;
    max-width: 52ch;

    font-size: 12px;
    line-height: 1.45;
    color: var(--ed-text-muted);
    opacity: 1;
}

.ed-row-control {
    justify-self: end;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.ed-row--stacked > .ed-row-control {
    justify-self: stretch;
    margin-top: 10px;
}

.ed-row-control--grow {
    width: min(320px, 100%);
}

.ed-row-control--grow > .ed-field {
    width: 100%;
}

/* ── Choice list ──────────────────────────────────────────────────────
 * Three visibility levels with real consequences were a bare <select> whose
 * options carried their whole explanation in the option text
 * ("unlisted — User-Groups - Authors and members of User-Groups"), which is
 * unreadable in a closed select and truncated in an open one.
 */
.ed-choices {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ed-choice {
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr);
    align-items: start;
    gap: 11px;

    padding: 11px 13px;

    background-color: var(--ed-surface);
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius-sm);

    cursor: pointer;

    transition: border-color 0.14s ease, background-color 0.14s ease;
}

.ed-choice:hover {
    border-color: var(--ed-border-strong);
    background-color: var(--ed-surface-sunken);
}

.ed-choice > input[type="radio"] {
    margin: 2px 0 0;
    width: 16px;
    height: 16px;
    accent-color: var(--ed-accent);
    cursor: pointer;
}

.ed-choice-text > strong {
    display: flex;
    align-items: center;
    gap: 7px;

    font-size: 13.5px;
    font-weight: 600;
    color: var(--ed-text);
}

.ed-choice-text > small {
    display: block;
    margin-top: 3px;

    font-size: 12px;
    line-height: 1.45;
    color: var(--ed-text-muted);
}

.ed-choice:has(> input:checked) {
    border-color: var(--ed-accent);
    background-color: color-mix(in srgb, var(--ed-accent) 6%, var(--ed-surface));
}

.ed-choice:has(> input:focus-visible) {
    outline: 2px solid var(--ed-accent);
    outline-offset: 2px;
}

.ed-choice > input:disabled {
    cursor: not-allowed;
}

.ed-choice:has(> input:disabled) {
    opacity: 0.55;
    cursor: not-allowed;
}

/* :has() is well supported but not universal; without it a selected option would
   be indistinguishable, so the class below is set from JS as a fallback. */
.ed-choice.is-selected {
    border-color: var(--ed-accent);
    background-color: color-mix(in srgb, var(--ed-accent) 6%, var(--ed-surface));
}

/* A footer bar for windows that commit rather than autosave. */
.ed-panel-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;

    flex: none;
    padding: 12px 16px;

    background-color: var(--ed-surface-sunken);
    border-top: 1px solid var(--ed-border);
}

.ed-panel-footer > .ed-panel-footer-note {
    margin-right: auto;
    font-size: 12px;
    color: var(--ed-text-muted);
}

/* </editor-fold> */

/* <editor-fold desc="Post summary card"> */

/* The header of the settings window: what this post looks like as a card in a
   grid, so the cover, title and status can be checked without leaving. */
.ed-postcard {
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    gap: 16px;

    margin-bottom: 18px;
    padding: 14px;

    background: linear-gradient(
        180deg,
        color-mix(in srgb, var(--ed-accent) 8%, var(--ed-surface)),
        var(--ed-surface)
    );
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
}

.ed-postcard-cover {
    position: relative;

    aspect-ratio: 16 / 10;
    border-radius: var(--ed-radius-sm);
    overflow: hidden;

    background-color: #dbe4ec;
    background-size: cover;
    background-position: center center;

    border: 1px solid var(--ed-border);
}

.ed-postcard-cover[data-empty="true"]::after {
    content: "\f03e";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;

    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;

    font-size: 20px;
    color: rgba(15, 23, 42, 0.28);
}

.ed-postcard-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    justify-content: center;
}

.ed-postcard-title {
    margin: 0;

    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--ed-text);

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Same cascade-origin trap as .ed-imgedit-preview-empty above: PostSettingsElement
 * renders this <p> with a `hidden` attribute and sets `.hidden = subtitle === ""`,
 * but `[hidden] { display: none }` comes from the user agent and the author
 * `display: -webkit-box` below beats it outright. So a post with no subtitle kept an
 * empty clamped paragraph in the settings summary card — a stray line of space under
 * the title that nothing accounted for. */
.ed-postcard-subtitle[hidden] {
    display: none;
}

.ed-postcard-subtitle {
    margin: 0;

    font-size: 12.5px;
    line-height: 1.45;
    color: var(--ed-text-muted);

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ed-postcard-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
}

.ed-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    padding: 2px 8px;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;

    background-color: var(--ed-surface-sunken);
    color: var(--ed-text-muted);
    border: 1px solid var(--ed-border);
}

.ed-badge > i {
    font-size: 9.5px;
}

.ed-badge--blue {
    background-color: color-mix(in srgb, var(--ed-accent) 12%, var(--ed-surface));
    border-color: color-mix(in srgb, var(--ed-accent) 26%, var(--ed-surface));
    color: var(--ed-accent-deep);
}

.ed-badge--green {
    background-color: color-mix(in srgb, var(--ed-success) 12%, var(--ed-surface));
    border-color: color-mix(in srgb, var(--ed-success) 28%, var(--ed-surface));
    color: var(--ed-success);
}

.ed-badge--amber {
    background-color: color-mix(in srgb, var(--ed-warning) 14%, var(--ed-surface));
    border-color: color-mix(in srgb, var(--ed-warning) 32%, var(--ed-surface));
    color: var(--ed-warning);
}

.ed-badge--red {
    background-color: color-mix(in srgb, var(--ed-danger) 10%, var(--ed-surface));
    border-color: color-mix(in srgb, var(--ed-danger) 28%, var(--ed-surface));
    color: var(--ed-danger);
}

@media (max-width: 700px) {
    .ed-postcard {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* The rail variant: one column, tighter, and it does not scroll away — it is the
   answer to "which post am I editing?" on every tab. */
.ed-postcard--rail {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;

    margin: 0;
    padding: 12px;

    background: none;
    border: 0;
    border-bottom: 1px solid var(--ed-border);
    border-radius: 0;
}

.ed-postcard--rail .ed-postcard-title {
    font-size: 13.5px;
    -webkit-line-clamp: 3;
}

.ed-postcard--rail .ed-postcard-subtitle {
    font-size: 11.5px;
    -webkit-line-clamp: 2;
}

.ed-postcard--rail .ed-postcard-meta {
    gap: 4px;
}

/* </editor-fold> */

/* <editor-fold desc="Cover image picker"> */

.ed-cover {
    position: relative;
    display: block;

    width: 100%;
    padding: 0;
    aspect-ratio: 2 / 1;

    border: 1px solid var(--ed-border-strong);
    border-radius: var(--ed-radius);

    background-color: #e2e8f0;
    background-size: cover;
    background-position: center center;

    cursor: pointer;
    overflow: hidden;

    transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.ed-cover:hover {
    border-color: var(--ed-accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ed-accent) 14%, transparent);
}

/* A scrim plus a labelled pill, instead of the 45px pencil that used to sit
   unexplained in the middle of the image. */
.ed-cover-overlay {
    position: absolute;
    inset: 0;

    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 14px;

    background: linear-gradient(180deg, rgba(15, 23, 42, 0) 45%, rgba(15, 23, 42, 0.55));

    opacity: 0;
    transition: opacity 0.16s ease;
}

.ed-cover:hover .ed-cover-overlay,
.ed-cover:focus-visible .ed-cover-overlay,
.ed-cover[data-empty="true"] .ed-cover-overlay {
    opacity: 1;
}

.ed-cover[data-empty="true"] .ed-cover-overlay {
    align-items: center;
    padding-bottom: 0;
    background: none;
}

.ed-cover-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    padding: 7px 13px;

    border-radius: 999px;

    background-color: rgba(255, 255, 255, 0.94);
    color: var(--ed-text);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.25);

    font-size: 12.5px;
    font-weight: 600;
}

/* </editor-fold> */

/* <editor-fold desc="Author rows"> */

.ed-authorlist {
    display: flex;
    flex-direction: column;
}

.ed-authorlist > .author-list-row,
.ed-authorlist > .ed-authorrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    padding: 10px 14px;
    border-top: 1px solid var(--ed-border);

    transition: background-color 0.14s ease;
}

.ed-authorlist > .author-list-row:first-child,
.ed-authorlist > .ed-authorrow:first-child {
    border-top: 0;
}

.ed-authorlist > .author-list-row:hover,
.ed-authorlist > .ed-authorrow:hover {
    background-color: var(--ed-surface-sunken);
}

.ed-authorlist .author-name-group {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

/* The circle itself is defined once, in Elements/AuthorSearchModal.css, because
   both surfaces that draw an author row share it. */
.ed-authorlist .author-avatar-placeholder {
    height: 34px;
    width: 34px;
}

.ed-authorlist .author-name-text {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ed-text);

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ed-authorlist .author-actions-group {
    flex: none;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ed-authorlist button.action-btn-icon {
    height: 32px;
    width: 32px;
    padding: 0;

    display: grid;
    place-items: center;

    border: 0;
    border-radius: var(--ed-radius-sm);

    background-color: transparent;
    color: var(--ed-text-faint);

    font-size: 13px;
    cursor: pointer;
    overflow: hidden;
    filter: none;

    transition: background-color 0.14s ease, color 0.14s ease;
}

.ed-authorlist button.action-btn-icon::after {
    content: none;
}

.ed-authorlist button.action-btn-icon:hover {
    background-color: rgba(15, 23, 42, 0.06);
    color: var(--ed-text);
    filter: none;
}

/* Out-specifies the legacy `.toggle-visible { ... !important }` in
   AuthorListElement.css, which painted the hidden state in the visible
   state's colours. */
.ed-authorlist button.action-btn-icon.toggle-visible.toggle-visible {
    color: var(--ed-text-faint);
    background-color: transparent;
}

.ed-authorlist button.action-btn-icon.toggle-visible.is-visible.is-visible {
    color: var(--ed-accent);
    background-color: color-mix(in srgb, var(--ed-accent) 10%, var(--ed-surface));
}

.ed-authorlist button.action-btn-icon.remove-author:hover {
    background-color: color-mix(in srgb, var(--ed-danger) 10%, var(--ed-surface));
    color: var(--ed-danger);
}

/* </editor-fold> */

/* <editor-fold desc="Permission table"> */

.ed-table {
    width: 100%;
    border-collapse: collapse;

    font-size: 13px;
}

.ed-table th {
    padding: 9px 14px;

    background-color: var(--ed-surface-sunken);
    border-bottom: 1px solid var(--ed-border);

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
    color: var(--ed-text-muted);
    white-space: nowrap;
}

.ed-table th.ed-table-center,
.ed-table td.ed-table-center {
    text-align: center;
    width: 74px;
}

.ed-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--ed-border);
    color: var(--ed-text);
}

.ed-table tr:last-child td {
    border-bottom: 0;
}

.ed-table tbody tr:hover {
    background-color: var(--ed-surface-sunken);
}

.ed-table input[type="checkbox"] {
    width: 17px;
    height: 17px;
    accent-color: var(--ed-accent);
    cursor: pointer;
}

.ed-table input[type="checkbox"]:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* A short list of caveats under a card, e.g. how the group permissions interact. */
.ed-notes {
    margin: 12px 0 0;
    padding: 12px 14px;

    background-color: var(--ed-surface-sunken);
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius-sm);

    list-style: none;
}

.ed-notes > li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 6px;

    font-size: 12px;
    line-height: 1.5;
    color: var(--ed-text-muted);
}

.ed-notes > li:last-child {
    margin-bottom: 0;
}

.ed-notes > li::before {
    content: "\f05a";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;

    position: absolute;
    left: 0;
    top: 1px;

    font-size: 10px;
    color: var(--ed-text-faint);
}

/* </editor-fold> */

/* <editor-fold desc="Tag editor"> */

.ed-taglist {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    align-items: center;
}

.ed-taglist .tag,
.ed-tag {
    display: inline-flex;
    align-items: center;
    gap: 7px;

    height: 28px;
    padding: 0 6px 0 11px;

    border-radius: 999px;

    background-color: color-mix(in srgb, var(--ed-accent) 10%, var(--ed-surface));
    border: 1px solid color-mix(in srgb, var(--ed-accent) 24%, var(--ed-surface));
    color: var(--ed-accent-deep);

    font-size: 12.5px;
    font-weight: 600;
    white-space: nowrap;
}

/* Tags in the editor are removed by clicking them, which nothing signalled. */
.ed-taglist .tag::after {
    content: "\f00d";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;

    display: grid;
    place-items: center;

    height: 18px;
    width: 18px;

    border-radius: 50%;
    font-size: 9px;

    color: var(--ed-accent);
    background-color: transparent;
    transition: background-color 0.14s ease, color 0.14s ease;
}

.ed-taglist .tag:hover {
    cursor: pointer;
}

.ed-taglist .tag:hover::after {
    background-color: var(--ed-danger);
    color: #ffffff;
}

.ed-taglist .tag.addtagbutton {
    padding: 0 12px;

    background-color: var(--ed-surface);
    border: 1px dashed var(--ed-border-strong);
    color: var(--ed-text-muted);

    cursor: pointer;
}

.ed-taglist .tag.addtagbutton::after {
    content: none;
}

.ed-taglist .tag.addtagbutton:hover {
    border-color: var(--ed-accent);
    color: var(--ed-accent);
    background-color: color-mix(in srgb, var(--ed-accent) 6%, var(--ed-surface));
}

/* </editor-fold> */

/* <editor-fold desc="Map tab"> */

.ed-map-shell {
    position: relative;

    height: 320px;
    border-radius: var(--ed-radius);
    border: 1px solid var(--ed-border-strong);

    overflow: hidden;
    background-color: #e6edf3;

    transition: opacity 0.25s ease, filter 0.25s ease;
}

.ed-map-shell[data-disabled="true"] {
    opacity: 0.55;
    filter: grayscale(0.55);
    pointer-events: none;
}

.ed-map-canvas {
    position: absolute;
    inset: 0;
}

/* Sits over the map when there is no location yet, so the disabled state reads
   as "off" rather than "broken". */
.ed-map-veil {
    position: absolute;
    inset: 0;
    z-index: 5;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 16px;

    background-color: rgba(241, 245, 249, 0.72);
    backdrop-filter: blur(1px);

    font-size: 13px;
    font-weight: 600;
    color: var(--ed-text-muted);
    text-align: center;
}

.ed-map-shell[data-disabled="true"] .ed-map-veil {
    display: flex;
}

/* The search box floats over the map's top-left, clear of mapbox's own
   navigation control on the right. */
.ed-map-search {
    position: absolute;
    top: 10px;
    left: 10px;
    right: 58px;
    z-index: 6;

    display: flex;
    gap: 6px;
}

.ed-map-search > .ed-field {
    background-color: rgba(255, 255, 255, 0.96);
    box-shadow: var(--ed-shadow);
    border-color: transparent;
}

.ed-map-results {
    position: absolute;
    top: 52px;
    left: 10px;
    right: 58px;
    z-index: 7;

    max-height: 190px;
    overflow-y: auto;

    background-color: var(--ed-surface);
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius-sm);
    box-shadow: var(--ed-shadow-md);
}

.ed-map-results[hidden] {
    display: none;
}

.ed-map-results > button {
    display: block;
    width: 100%;
    height: auto;
    padding: 9px 12px;
    margin: 0;

    border: 0;
    border-bottom: 1px solid var(--ed-border);
    border-radius: 0;

    background-color: transparent;
    color: var(--ed-text);

    font-family: var(--ed-font);
    font-size: 12.5px;
    font-weight: 500;
    text-align: left;
    white-space: normal;

    cursor: pointer;
    overflow: hidden;
    filter: none;
}

.ed-map-results > button::after {
    content: none;
}

.ed-map-results > button:last-child {
    border-bottom: 0;
}

.ed-map-results > button:hover {
    background-color: color-mix(in srgb, var(--ed-accent) 8%, var(--ed-surface));
    filter: none;
}

.ed-map-hint {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 6;

    padding: 5px 10px;

    border-radius: 999px;

    background-color: rgba(15, 23, 42, 0.72);
    color: #ffffff;

    font-size: 11.5px;
    font-weight: 500;
}

.ed-coords {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

/* </editor-fold> */

/* <editor-fold desc="Statistics"> */

#poststatistics {
    position: fixed;
    inset: 0;
    z-index: 2000;

    display: none;
}

#poststatistics.is-open {
    display: block;
}

#poststatistics .ed-stats-backdrop {
    position: absolute;
    inset: 0;

    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(5px);
}

#poststatistics .window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);

    opacity: 1;

    height: min(80vh, 700px);
    width: min(94vw, 940px);
    aspect-ratio: unset;

    display: flex;
    flex-direction: column;
}

.ed-stats-body {
    flex: 1 1 auto;
    min-height: 0;

    display: flex;
    flex-direction: column;
    gap: 16px;

    padding: 18px 20px 20px;
    overflow-y: auto;

    background-color: var(--ed-surface-sunken);
}

.ed-stats-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.ed-stats-toolbar-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ed-stats-toolbar-label {
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ed-text-faint);
}

.ed-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.ed-kpi {
    padding: 14px 16px;

    background-color: var(--ed-surface);
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    box-shadow: var(--ed-shadow-sm);
}

.ed-kpi-label {
    display: flex;
    align-items: center;
    gap: 7px;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--ed-text-faint);
}

.ed-kpi-value {
    margin-top: 7px;

    font-size: 25px;
    font-weight: 700;
    line-height: 1.1;
    color: var(--ed-text);
    font-variant-numeric: tabular-nums;
}

.ed-kpi-sub {
    margin-top: 4px;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--ed-text-muted);
}

.ed-kpi-sub--up {
    color: var(--ed-success);
}

.ed-kpi-sub--down {
    color: var(--ed-danger);
}

.ed-stats-chartcard {
    position: relative;
    flex: 1 1 auto;
    min-height: 260px;

    display: flex;
    flex-direction: column;

    padding: 16px;

    background-color: var(--ed-surface);
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    box-shadow: var(--ed-shadow-sm);
}

.ed-stats-chartwrap {
    position: relative;
    flex: 1 1 auto;
    min-height: 220px;
}

.ed-stats-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;

    display: none;
    align-items: center;
    justify-content: center;

    background-color: color-mix(in srgb, var(--ed-surface) 88%, transparent);
    border-radius: var(--ed-radius);
}

.ed-stats-overlay[data-visible="true"] {
    display: flex;
}

/* </editor-fold> */

/* <editor-fold desc="Image block affordance"> */

/* The old treatment was a 100px pencil dropped in the middle of the picture on
   hover, with no other change and no label. This is a scrim, a hairline ring
   and a row of labelled actions in the corner. */
.image-tool {
    position: relative;
}

.image-tool:hover {
    /* Was `filter: brightness(0.95)` on the whole block, which dimmed the caption
       text beside the image as well. The overlay below does the dimming now. */
    filter: none;
}

.image-tool > .change-icon {
    /* The old single pencil. Kept out of the way in case a cached copy of
       ImageTool.js still renders one. */
    display: none !important;
}

.ed-image-overlay {
    position: absolute;
    inset: 0;
    z-index: 3;

    display: flex;
    align-items: flex-start;
    justify-content: flex-end;
    gap: 6px;

    padding: 10px;

    border-radius: inherit;

    background: linear-gradient(180deg, rgba(15, 23, 42, 0.34) 0%, rgba(15, 23, 42, 0) 46%);

    opacity: 0;
    pointer-events: none;

    transition: opacity 0.16s ease;
}

.image-tool:hover > .ed-image-overlay,
.image-tool:focus-within > .ed-image-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Outlines the picture itself on hover so it is obvious which block is about to
   be edited, without moving anything. */
.ed-image-outline {
    position: absolute;
    inset: 0;
    z-index: 2;

    border: 2px solid transparent;
    border-radius: inherit;

    pointer-events: none;
    transition: border-color 0.16s ease;
}

.image-tool:hover > .ed-image-outline {
    border-color: color-mix(in srgb, var(--ed-accent) 70%, transparent);
}

button.ed-image-action {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    height: 30px;
    width: auto;
    padding: 0 11px;
    margin: 0;

    border: 0;
    border-radius: 999px;

    background-color: rgba(255, 255, 255, 0.95);
    color: var(--ed-text);
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.3);

    font-family: var(--ed-font);
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;

    cursor: pointer;
    overflow: hidden;
    filter: none;

    transition: background-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

button.ed-image-action::after {
    content: none;
}

button.ed-image-action:hover {
    background-color: #ffffff;
    color: var(--ed-accent-deep);
    transform: translateY(-1px);
    filter: none;
}

button.ed-image-action:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}

button.ed-image-action--icon {
    width: 30px;
    padding: 0;
    justify-content: center;
}

/* A picture with no source yet reads as a drop target rather than as a broken
   image, and keeps its actions on screen without a hover — an image block with
   no picture is dropped when the post is saved, so it has to be obvious that it
   still needs one. */
.image-tool[data-placeholder="true"] .image {
    background-color: var(--ed-surface-sunken);
    outline: 1px dashed var(--ed-border-strong);
    outline-offset: -1px;
}

.image-tool[data-placeholder="true"] > .ed-image-overlay {
    opacity: 1;
    pointer-events: auto;
}

.image-tool[data-placeholder="true"] > .ed-image-outline {
    border-color: var(--ed-border-strong);
    border-style: dashed;
}

/* The link card gets the same treatment as an image block. */
.linkListEntry[data-editmode="true"] {
    position: relative;
}

.linkListEntry[data-editmode="true"]:hover > .ed-image-overlay,
.linkListEntry[data-editmode="true"]:focus-within > .ed-image-overlay {
    opacity: 1;
    pointer-events: auto;
}

.linkListEntry[data-editmode="true"] > .ed-image-overlay > .ed-image-action {
    /* No scrim behind these — the card is a white surface, not a photograph. */
    background-color: var(--ed-surface);
    border: 1px solid var(--ed-border);
    box-shadow: var(--ed-shadow);
}

/* </editor-fold> */

/* <editor-fold desc="Inline link tool"> */

/* editorjs-hyperlink ships a green save button and three stacked full-width
   controls; inside EditorJS's own white popover that reads as a different
   product. These rules restyle it in place — the library is vendored and its
   markup is fixed, so the class names below are its own. */
.ce-inline-tool-hyperlink-wrapper {
    box-sizing: border-box;
    width: 300px;
    max-width: min(300px, calc(100vw - 24px));
    padding: 12px !important;

    border-top: 1px solid var(--ed-border) !important;
    border-radius: 0 0 var(--ed-radius) var(--ed-radius) !important;

    background-color: var(--ed-surface);
    font-family: var(--ed-font) !important;
}

.ce-inline-tool-hyperlink-wrapper::before {
    content: "Link";

    display: block;
    margin-bottom: 8px;

    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--ed-text-faint);
}

.ce-inline-tool-hyperlink--input {
    box-sizing: border-box;
    width: 100%;
    padding: 8px 11px !important;
    margin-bottom: 8px !important;

    border: 1px solid var(--ed-border-strong) !important;
    border-radius: var(--ed-radius-sm) !important;
    box-shadow: none !important;

    font-family: var(--ed-font);
    font-size: 13px;
    color: var(--ed-text);
}

.ce-inline-tool-hyperlink--input:focus {
    outline: none;
    border-color: var(--ed-accent) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--ed-accent) 16%, transparent) !important;
}

/* The two selects were 48% wide and sat side by side with no labels, so
   "Select target" and "Select rel" were the only clue as to what they did. They
   are stacked and labelled here. */
.ce-inline-tool-hyperlink--select-target,
.ce-inline-tool-hyperlink--select-rel {
    box-sizing: border-box;
    width: 100% !important;
    display: block !important;
    margin: 0 0 8px !important;
    padding: 7px 28px 7px 10px !important;

    border: 1px solid var(--ed-border-strong) !important;
    border-radius: var(--ed-radius-sm) !important;
    box-shadow: none !important;

    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%2364748b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6.5 8 10.5 12 6.5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 9px center;
    background-size: 13px 13px;
    background-color: var(--ed-surface);

    font-family: var(--ed-font);
    font-size: 12.5px;
    color: var(--ed-text);
    cursor: pointer;
}

.ce-inline-tool-hyperlink--button {
    box-sizing: border-box;
    width: 100%;
    height: 34px !important;
    padding: 0 !important;

    border: 1px solid var(--ed-accent) !important;
    border-radius: var(--ed-radius-sm) !important;

    /* Was #34c38f — a green that appears nowhere else on the site. */
    background-color: var(--ed-accent) !important;
    color: #ffffff !important;

    font-family: var(--ed-font) !important;
    font-size: 13px !important;
    font-weight: 600 !important;

    cursor: pointer;
    overflow: hidden;
}

.ce-inline-tool-hyperlink--button::after {
    content: none !important;
}

.ce-inline-tool-hyperlink--button:hover {
    background-color: var(--ed-accent-deep) !important;
    border-color: var(--ed-accent-deep) !important;
    filter: none !important;
}

/* The tool renders two empty <svg><use href="#link"></svg> elements and relies
   on a sprite EditorJS 2.31 no longer ships, so the button was blank — a
   14x10px invisible target between Bold and Italic. posteditor.js injects the
   sprite; this sizes what comes out of it. */
.ce-inline-tool--link .icon--link,
.ce-inline-tool--link .icon--unlink,
.ce-inline-tool--unlink .icon--link,
.ce-inline-tool--unlink .icon--unlink {
    width: 15px;
    height: 15px;
    vertical-align: middle;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* </editor-fold> */

/* <editor-fold desc="Help window"> */

.ed-help-section {
    margin-bottom: 22px;
}

.ed-help-section:last-child {
    margin-bottom: 0;
}

.ed-help-section > h3 {
    margin: 0 0 8px;

    font-family: var(--ed-font);
    font-size: 14px;
    font-weight: 700;
    color: var(--ed-text);
}

.ed-help-section > p {
    margin: 0 0 10px;
    max-width: 68ch;

    font-size: 13px;
    line-height: 1.6;
    color: var(--ed-text-muted);
}

.ed-help-steps {
    margin: 0;
    padding-left: 20px;
}

.ed-help-steps > li {
    margin-bottom: 7px;
    font-size: 13px;
    line-height: 1.6;
    color: var(--ed-text-muted);
}

.ed-help-steps > li > strong {
    color: var(--ed-text);
}

.ed-shortcuts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 6px 20px;
}

.ed-shortcut {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    padding: 7px 0;
    border-bottom: 1px solid var(--ed-border);

    font-size: 13px;
    color: var(--ed-text-muted);
}

.ed-shortcut > kbd {
    flex: none;

    padding: 2px 7px;

    border: 1px solid var(--ed-border-strong);
    border-bottom-width: 2px;
    border-radius: 5px;

    background-color: var(--ed-surface-sunken);
    color: var(--ed-text);

    font-family: var(--ed-font);
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.ed-blocklist {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 8px;
}

.ed-blockcard {
    display: flex;
    align-items: flex-start;
    gap: 10px;

    padding: 11px 12px;

    background-color: var(--ed-surface-sunken);
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius-sm);
}

.ed-blockcard > i {
    flex: none;

    display: grid;
    place-items: center;

    height: 26px;
    width: 26px;

    border-radius: var(--ed-radius-sm);

    background-color: color-mix(in srgb, var(--ed-accent) 12%, var(--ed-surface));
    color: var(--ed-accent-deep);
    font-size: 12px;
}

.ed-blockcard-text > strong {
    display: block;
    font-size: 12.5px;
    color: var(--ed-text);
}

.ed-blockcard-text > small {
    display: block;
    margin-top: 2px;
    font-size: 11.5px;
    line-height: 1.45;
    color: var(--ed-text-muted);
}

/* </editor-fold> */

/* <editor-fold desc="Image editor"> */

.ed-imgedit-preview {
    position: relative;

    display: grid;
    place-items: center;

    min-height: 190px;
    padding: 14px;
    margin-bottom: 16px;

    background-color: var(--ed-surface-sunken);
    background-image:
        linear-gradient(45deg, #eef2f6 25%, transparent 25%),
        linear-gradient(-45deg, #eef2f6 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, #eef2f6 75%),
        linear-gradient(-45deg, transparent 75%, #eef2f6 75%);
    background-size: 16px 16px;
    background-position: 0 0, 0 8px, 8px -8px, -8px 0;

    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius);
    overflow: hidden;
}

.ed-imgedit-preview > img {
    max-width: 100%;
    max-height: 240px;

    /* Mirrors the block's own object-fit/radius so the preview is honest about
       what the article will show. */
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.14);
    transition: border-radius 0.16s ease, width 0.16s ease;
}

/* The `hidden` attribute has to be spelled out, or it does nothing here.
 *
 * ImageEditor.refreshPreview() sets `empty.hidden = true` as soon as the block has
 * a picture, and that had no effect at all: `[hidden] { display: none }` is a
 * *user-agent* rule, and any author declaration beats the user agent on cascade
 * origin regardless of specificity — so the `display: flex` below won every time.
 *
 * The result was that "No image chosen yet" was on screen permanently. It only
 * looked wrong once a picture had been chosen, because .ed-imgedit-preview is a
 * grid with the default row flow: the image took the first row and the placeholder
 * sat underneath it, contradicting it.
 *
 * The attribute selector scores (0,2,0) against the rule below at (0,1,0), so this
 * wins on specificity as well as coming later. Same guard as the six others in this
 * file. */
.ed-imgedit-preview-empty[hidden] {
    display: none;
}

.ed-imgedit-preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;

    color: var(--ed-text-faint);
    font-size: 12.5px;
}

.ed-imgedit-preview-empty > i {
    font-size: 24px;
    opacity: 0.5;
}

/* The width preset row doubles as a slider; both write the same value. */
.ed-range {
    -webkit-appearance: none;
    appearance: none;

    width: 100%;
    height: 4px;
    margin: 0;

    border-radius: 999px;
    background-color: var(--ed-border);
    cursor: pointer;
}

.ed-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;

    height: 16px;
    width: 16px;

    border: 2px solid var(--ed-surface);
    border-radius: 50%;
    background-color: var(--ed-accent);
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.3);
}

.ed-range::-moz-range-thumb {
    height: 14px;
    width: 14px;

    border: 2px solid var(--ed-surface);
    border-radius: 50%;
    background-color: var(--ed-accent);
}

.ed-range-value {
    min-width: 44px;
    text-align: right;

    font-size: 12.5px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    color: var(--ed-text-muted);
}

/* Rows that only apply to one branch of a choice (the URL field under
   "open a link") are collapsed rather than left greyed out. */
.ed-conditional[hidden] {
    display: none;
}

/* </editor-fold> */

/* <editor-fold desc="Inline author controls (article page)"> */

/* Editors can add and remove the people credited on a post from the post itself
   rather than only from inside the settings window. */
.ed-authorbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;

    margin: 6px 0 18px;
    padding: 10px 12px;

    background-color: var(--ed-surface-sunken);
    border: 1px dashed var(--ed-border-strong);
    border-radius: var(--ed-radius);

    font-family: var(--ed-font);
}

.ed-authorbar-label {
    margin-right: auto;

    font-size: 12px;
    font-weight: 600;
    color: var(--ed-text-muted);
}

/* The controls attached to a rendered author card. The card itself is a shadow
   DOM custom element, so the controls are a sibling positioned over it. */
.ed-authorcard-wrap {
    position: relative;
}

.ed-authorcard-controls {
    position: absolute;
    top: 10px;
    right: 12%;
    z-index: 4;

    display: flex;
    gap: 6px;

    opacity: 0;
    transition: opacity 0.16s ease;
}

.ed-authorcard-wrap:hover .ed-authorcard-controls,
.ed-authorcard-wrap:focus-within .ed-authorcard-controls {
    opacity: 1;
}

button.ed-authorcard-btn {
    display: grid;
    place-items: center;

    height: 30px;
    width: 30px;
    padding: 0;
    margin: 0;

    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius-sm);

    background-color: var(--ed-surface);
    color: var(--ed-text-muted);

    font-size: 12px;
    line-height: 1;

    cursor: pointer;
    overflow: hidden;
    filter: none;
    box-shadow: var(--ed-shadow-sm);

    transition: background-color 0.14s ease, color 0.14s ease;
}

button.ed-authorcard-btn::after {
    content: none;
}

button.ed-authorcard-btn:hover {
    background-color: var(--ed-surface-hover);
    color: var(--ed-text);
    filter: none;
}

button.ed-authorcard-btn--danger:hover {
    background-color: color-mix(in srgb, var(--ed-danger) 10%, var(--ed-surface));
    color: var(--ed-danger);
    border-color: color-mix(in srgb, var(--ed-danger) 30%, var(--ed-surface));
}

/* An author the reader will not see is still drawn in the editor, so the list on
   the page matches the list in the settings window — but it has to be obvious
   which is which. */
.ed-authorcard-wrap[data-hidden-author="true"] > person-card {
    display: block;
    opacity: 0.5;
    filter: grayscale(0.6);
}

.ed-authorcard-note {
    margin: -12px 10% 14px;
    padding: 6px 12px;

    background-color: var(--ed-surface-sunken);
    border: 1px solid var(--ed-border);
    border-radius: var(--ed-radius-sm);

    font-family: var(--ed-font);
    font-size: 12px;
    line-height: 1.45;
    color: var(--ed-text-muted);
}

/* </editor-fold> */

/* <editor-fold desc="Fallbacks"> */

/* color-mix landed in every evergreen browser in 2023, but the editor is used on
   school machines; without this the mixed values resolve to nothing and the
   affected surfaces render transparent. */
@supports not (color: color-mix(in srgb, red, blue)) {
    .ed-menu .ed-menu-item:hover,
    .ed-menu .ed-menu-item:focus-visible,
    #posteditorToolbar button.ed-menubar-item[aria-expanded="true"] {
        background-color: #e8f0f8;
    }

    .ed-badge--blue,
    .ed-tag,
    .ed-taglist .tag {
        background-color: #e8f0f8;
        border-color: #c3d9ec;
    }

    .ed-chip[data-state="secure"] {
        background-color: #e8f6ed;
        border-color: #b7e0c6;
    }

    .ed-chip[data-state="warning"] {
        background-color: #fdf1e0;
        border-color: #f0d3a4;
    }

    .ed-chip[data-state="broken"] {
        background-color: #fbeae7;
        border-color: #edc2ba;
    }

    .ed-postcard {
        background: var(--ed-surface);
    }
}

/* </editor-fold> */
