/* =========================================================
   FOR YOU NEWS
   ARTICLE EDITOR
   PROFESSIONAL NEWSROOM EDITOR STYLES

   Scroll behaviour (sections 2, 6, 9) works together with
   initializeScrollBehavior() in article-editor.js, which
   sets --editor-header-height and toggles
   body.editor-header-hidden.
   ========================================================= */


/* =========================================================
   1. GLOBAL
   ========================================================= */

:root {

    --editor-page-bg: #f5f6f4;
    --editor-card-bg: #ffffff;
    --editor-surface: #ffffff;
    --editor-surface-soft: #f8f9f8;

    --editor-border: #dfe3df;
    --editor-border-light: #e9ece9;
    --editor-border-dark: #cfd4cf;

    --editor-text: #202522;
    --editor-text-soft: #59615b;
    --editor-text-muted: #7b837d;

    --editor-primary: #111512;
    --editor-primary-hover: #252b27;

    --editor-accent: #d99a18;
    --editor-accent-dark: #b77b08;
    --editor-accent-soft: #fff5dc;

    --editor-focus: rgba(217, 154, 24, 0.18);

    --editor-danger: #b42318;
    --editor-success: #177245;

    --editor-shadow-sm: 0 1px 2px rgba(16, 24, 20, 0.04);
    --editor-shadow-md: 0 8px 24px rgba(16, 24, 20, 0.07);

    --editor-radius: 8px;
    --editor-radius-sm: 6px;

    --editor-content-width: 1280px;

    --editor-sidebar-width: 320px;

    --toolbar-height: 44px;
    --menu-height: 36px;

    --editor-font:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    /* Scroll behaviour. The JS replaces the header height
       with the real measured value. */
    --editor-header-height: 68px;
    --editor-sticky-top: var(--editor-header-height);
    --editor-slide-speed: 0.25s;
}


/* Header hidden → tools and sidebar move up to the top */
body.editor-header-hidden {
    --editor-sticky-top: 0px;
}


*,
*::before,
*::after {
    box-sizing: border-box;
}


html {
    scroll-behavior: smooth;

    /* Keeps jumped-to text from hiding under the sticky tools */
    scroll-padding-top: calc(var(--editor-header-height) + 110px);
}


body {
    margin: 0;
    min-height: 100vh;

    background: var(--editor-page-bg);
    color: var(--editor-text);

    font-family: var(--editor-font);
    font-size: 15px;
    line-height: 1.5;

    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}


button,
input,
textarea,
select {
    font: inherit;
}


button {
    cursor: pointer;
}


button:disabled {
    cursor: not-allowed;
}


a {
    color: inherit;
}


img {
    max-width: 100%;
}


[hidden] {
    display: none !important;
}


/* =========================================================
   2. EDITOR HEADER
   Slides up out of view when scrolling down, slides back
   when scrolling up.
   ========================================================= */

.editor-header {
    position: sticky;
    top: 0;
    z-index: 1000;

    width: 100%;
    height: 68px;

    background: rgba(255, 255, 255, 0.97);
    border-bottom: 1px solid var(--editor-border);
    box-shadow: var(--editor-shadow-sm);
    backdrop-filter: blur(10px);

    transition: transform var(--editor-slide-speed) ease;
    will-change: transform;
}


body.editor-header-hidden .editor-header {
    transform: translateY(-100%);
}


.editor-header-inner {
    width: min(var(--editor-content-width), calc(100% - 48px));
    height: 100%;
    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}


.editor-header-left {
    min-width: 0;

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


.editor-back-link {
    display: inline-flex;
    align-items: center;

    min-height: 34px;
    padding: 0 10px;

    color: var(--editor-text-soft);
    text-decoration: none;

    font-size: 14px;
    font-weight: 600;

    border-radius: 6px;

    transition:
        background 0.15s ease,
        color 0.15s ease;
}


.editor-back-link:hover {
    background: var(--editor-surface-soft);
    color: var(--editor-text);
}


.editor-brand {
    display: flex;
    align-items: center;
    gap: 9px;

    min-width: 0;
}


/* The logo link wraps the image and brand text */
.editor-brand .editor-back-link {
    gap: 9px;
    padding: 0 6px;
}


.editor-logo {
    width: 36px;
    height: 36px;

    object-fit: contain;

    flex: 0 0 auto;
}


.editor-brand-text {
    display: flex;
    flex-direction: column;
    justify-content: center;

    line-height: 1.05;
    white-space: nowrap;
}


.editor-brand-text strong {
    color: var(--editor-text);

    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.07em;
}


.editor-brand-text span {
    margin-top: 3px;

    color: var(--editor-text-muted);

    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.18em;
}


.editor-header-actions {
    display: flex;
    align-items: center;
    gap: 9px;

    flex: 0 0 auto;
}


/* =========================================================
   3. GENERAL EDITOR BUTTONS
   ========================================================= */

.editor-button {
    min-height: 38px;
    padding: 0 16px;

    border: 1px solid transparent;
    border-radius: 6px;

    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;

    transition:
        background 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.1s ease;
}


.editor-button:active {
    transform: translateY(1px);
}


.editor-button-primary {
    background: var(--editor-primary);
    border-color: var(--editor-primary);
    color: #ffffff;
}


.editor-button-primary:hover {
    background: var(--editor-primary-hover);
    border-color: var(--editor-primary-hover);
}


.editor-button-secondary {
    background: #ffffff;
    border-color: var(--editor-border-dark);
    color: var(--editor-text);
}


.editor-button-secondary:hover {
    background: var(--editor-surface-soft);
    border-color: #bfc5c0;
}


.editor-button:focus-visible,
.editor-back-link:focus-visible {
    outline: 2px solid var(--editor-accent);
    outline-offset: 2px;
}


/* =========================================================
   4. PAGE
   Sticky elements need every parent to keep
   overflow: visible, so none is set here.
   ========================================================= */

.editor-page {
    width: min(var(--editor-content-width), calc(100% - 48px));
    margin: 0 auto;
    padding: 38px 0 64px;
}


.editor-page-heading {
    margin-bottom: 24px;
}


.card-eyebrow {
    margin: 0 0 7px;

    color: var(--editor-accent-dark);

    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.14em;
    line-height: 1.3;
}


.editor-page-heading h1 {
    margin: 0;

    color: var(--editor-text);

    font-size: 30px;
    line-height: 1.15;
    font-weight: 750;
    letter-spacing: -0.025em;
}


.editor-page-heading > p:last-child {
    margin: 8px 0 0;

    color: var(--editor-text-soft);

    font-size: 14px;
}


/* =========================================================
   5. MESSAGE
   ========================================================= */

.editor-message {
    margin: 0 0 18px;
    padding: 11px 14px;

    border: 1px solid var(--editor-border);
    border-radius: 7px;

    background: #ffffff;
    color: var(--editor-text);

    font-size: 13px;
    line-height: 1.45;
}


.editor-message.success {
    border-color: rgba(23, 114, 69, 0.25);
    background: rgba(23, 114, 69, 0.06);
    color: var(--editor-success);
}


.editor-message.error {
    border-color: rgba(180, 35, 24, 0.25);
    background: rgba(180, 35, 24, 0.06);
    color: var(--editor-danger);
}


.editor-message.warning {
    border-color: rgba(217, 154, 24, 0.35);
    background: rgba(217, 154, 24, 0.08);
    color: var(--editor-accent-dark);
}


/* =========================================================
   5b. EDITOR'S NOTE (REJECTED ARTICLES)
   Created by renderReviewNote() in article-editor.js
   ========================================================= */

.editor-review-note {
    border-left-width: 4px;
}


.editor-review-note strong {
    display: block;
    margin-bottom: 4px;

    font-size: 13px;
    font-weight: 800;
}


.editor-review-note p {
    margin: 0;

    color: var(--editor-text);

    white-space: pre-line;
}


/* =========================================================
   6. MAIN LAYOUT
   ========================================================= */

.article-editor-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) var(--editor-sidebar-width);
    align-items: start;
    gap: 24px;
}


.editor-main-column {
    min-width: 0;
}


.editor-sidebar {
    min-width: 0;

    display: flex;
    flex-direction: column;
    gap: 18px;
}


/*
 * Sidebar stays in view beside the article and scrolls
 * inside itself (it is taller than the screen). When the
 * article ends, it scrolls away with the page.
 * Only while it sits beside the article: at 900px and
 * below it moves under the article (section 42).
 */
@media (min-width: 901px) {

    .editor-sidebar {
        position: sticky;
        top: calc(var(--editor-sticky-top) + 16px);

        align-self: start;

        max-height: calc(100vh - var(--editor-sticky-top) - 32px);
        overflow-y: auto;
        overscroll-behavior: contain;

        /* Room so card shadows and focus rings aren't clipped */
        padding: 2px 4px 2px 2px;
        margin: -2px -4px -2px -2px;

        scrollbar-width: thin;
        scrollbar-color: #d5d9d4 transparent;

        transition:
            top var(--editor-slide-speed) ease,
            max-height var(--editor-slide-speed) ease;
    }


    .editor-sidebar::-webkit-scrollbar {
        width: 6px;
    }


    .editor-sidebar::-webkit-scrollbar-thumb {
        background: #d5d9d4;
        border-radius: 3px;
    }

}


/* =========================================================
   7. WRITING CARD
   ========================================================= */

.editor-writing-card {
    overflow: visible;

    background: var(--editor-card-bg);
    border: 1px solid var(--editor-border);
    border-radius: var(--editor-radius);
    box-shadow: var(--editor-shadow-sm);
}


/* =========================================================
   8. TITLE AREA
   ========================================================= */

.editor-title-section {
    padding: 24px 28px 18px;

    border-bottom: 1px solid var(--editor-border-light);
}


.editor-title-label {
    display: block;
    margin-bottom: 8px;

    color: var(--editor-text-soft);

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
}


#article-title {
    display: block;

    width: 100%;
    min-height: 52px;
    padding: 7px 0;

    border: 0;
    outline: 0;
    background: transparent;

    color: var(--editor-text);

    font-family: var(--editor-font);
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.025em;
}


#article-title::placeholder {
    color: #a4aaa5;
    opacity: 1;
}


#article-title:focus {
    outline: 0;
}


.editor-title-meta {
    display: flex;
    justify-content: flex-end;

    margin-top: 4px;
}


.editor-title-meta span {
    color: var(--editor-text-muted);

    font-size: 11px;
    line-height: 1.3;
}


/* =========================================================
   9. EDITOR CONTROLS WRAPPER
   Menu bar + toolbar stick to the top while writing:
   directly under the header when it is visible, at the
   very top when it has slid away. They stop at the end of
   the writing card.
   ========================================================= */

.editor-controls {
    position: sticky;
    top: var(--editor-sticky-top);

    /* Below the header (1000) so the header slides over it */
    z-index: 900;

    border-bottom: 1px solid var(--editor-border);
    background: #ffffff;

    transition:
        top var(--editor-slide-speed) ease,
        box-shadow 0.2s ease;
}


/* Shadow once stuck, so text scrolling underneath doesn't
   blend into the tools */
.editor-controls.is-stuck {
    box-shadow: 0 6px 14px -8px rgba(17, 21, 18, 0.28);
}


/* =========================================================
   10. TOP MENU BAR
   ========================================================= */

.editor-menu-bar {
    position: relative;

    display: flex;
    align-items: center;
    gap: 2px;

    min-height: var(--menu-height);
    padding: 3px 12px;

    background: #ffffff;
    border-bottom: 1px solid var(--editor-border-light);
}


.editor-menu {
    position: relative;

    flex: 0 0 auto;
}


.editor-menu-button {
    display: inline-flex;
    align-items: center;

    min-height: 29px;
    padding: 0 10px;

    border: 1px solid transparent;
    border-radius: 5px;

    background: transparent;
    color: var(--editor-text-soft);

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

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


.editor-menu-button:hover {
    background: var(--editor-surface-soft);
    color: var(--editor-text);
}


.editor-menu-button[aria-expanded="true"] {
    background: #eef0ed;
    border-color: var(--editor-border-light);
    color: var(--editor-text);

    font-weight: 700;
}


.editor-menu-button:focus-visible {
    outline: 2px solid var(--editor-accent);
    outline-offset: 1px;
}


/* =========================================================
   11. MENU DROPDOWNS
   ========================================================= */

.editor-menu-dropdown,
.editor-toolbar-dropdown {
    z-index: 1200;

    min-width: 190px;
    padding: 5px;

    background: #ffffff;
    border: 1px solid var(--editor-border);
    border-radius: 7px;

    box-shadow:
        0 12px 28px rgba(16, 24, 20, 0.12),
        0 2px 5px rgba(16, 24, 20, 0.05);
}


.editor-menu-dropdown {
    /*
     * The top menu bar has no overflow set, so ordinary
     * absolute positioning relative to the trigger works.
     */
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
}


.editor-toolbar-dropdown {
    /*
     * .editor-toolbar scrolls horizontally (overflow-x: auto),
     * which also makes it clip vertically. Fixed positioning,
     * with top/left set by positionToolbarDropdown() in
     * article-editor.js, escapes that clipping.
     */
    position: fixed;
}


.editor-menu-dropdown-wide {
    min-width: 220px;
}


.editor-menu-dropdown button,
.editor-toolbar-dropdown button {
    display: flex;
    align-items: center;

    width: 100%;
    min-height: 32px;
    padding: 0 10px;

    border: 0;
    border-radius: 5px;

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

    text-align: left;
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;

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


.editor-menu-dropdown button:hover,
.editor-toolbar-dropdown button:hover {
    background: var(--editor-surface-soft);
    color: var(--editor-text);
}


.editor-menu-dropdown button:focus-visible,
.editor-toolbar-dropdown button:focus-visible {
    outline: 2px solid var(--editor-accent);
    outline-offset: -2px;
}


.editor-menu-dropdown button.is-active,
.editor-toolbar-dropdown button.is-active {
    background: var(--editor-accent-soft);
    color: var(--editor-accent-dark);

    font-weight: 700;
}


.editor-dropdown-divider {
    height: 1px;
    margin: 5px 4px;

    background: var(--editor-border-light);
}


/* =========================================================
   12. QUICK TOOLBAR
   ========================================================= */

.editor-toolbar {
    position: relative;

    display: flex;
    align-items: center;
    gap: 6px;

    min-height: var(--toolbar-height);
    padding: 5px 10px;

    background: #ffffff;

    overflow-x: auto;
    overflow-y: visible;

    scrollbar-width: thin;
    scrollbar-color: #cfd4cf transparent;
}


.editor-toolbar::-webkit-scrollbar {
    height: 5px;
}


.editor-toolbar::-webkit-scrollbar-track {
    background: transparent;
}


.editor-toolbar::-webkit-scrollbar-thumb {
    background: #cfd4cf;
    border-radius: 999px;
}


.editor-toolbar-group {
    display: inline-flex;
    align-items: center;
    gap: 2px;

    flex: 0 0 auto;
}


.editor-toolbar-divider {
    display: block;

    width: 1px;
    height: 24px;
    margin: 0 3px;

    flex: 0 0 auto;

    background: var(--editor-border);
}


/* =========================================================
   13. TOOLBAR BUTTONS
   ========================================================= */

.editor-toolbar-button {
    position: relative;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    width: 32px;
    height: 32px;
    padding: 0;

    border: 1px solid transparent;
    border-radius: 5px;

    background: transparent;
    color: #4d554f;

    flex: 0 0 32px;

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


.editor-toolbar-button:hover {
    background: #f0f2f0;
    border-color: #e1e4e1;
    color: var(--editor-text);
}


.editor-toolbar-button:focus-visible {
    outline: 2px solid var(--editor-accent);
    outline-offset: 1px;
}


.editor-toolbar-button svg {
    width: 17px;
    height: 17px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;

    pointer-events: none;

    transition:
        stroke-width 0.12s ease,
        transform 0.12s ease;
}


/* =========================================================
   14. ACTIVE TOOLBAR STATES
   ========================================================= */

.editor-toolbar-button.is-active,
.editor-toolbar-button[aria-pressed="true"],
.editor-toolbar-button.active {
    background: #e8ebe8;
    border-color: #d4d9d4;
    color: #171b18;

    font-weight: 700;
}


.editor-toolbar-button.is-active svg,
.editor-toolbar-button[aria-pressed="true"] svg,
.editor-toolbar-button.active svg {
    stroke-width: 2.65;
}


.editor-toolbar-button.is-active:hover,
.editor-toolbar-button[aria-pressed="true"]:hover,
.editor-toolbar-button.active:hover {
    background: #e1e5e1;
    border-color: #cbd0cb;
}


/* =========================================================
   15. TOOLBAR SELECT CONTROLS
   ========================================================= */

.editor-toolbar-select {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;

    min-width: 84px;
    height: 32px;
    padding: 0 9px;

    border: 1px solid transparent;
    border-radius: 5px;

    background: transparent;
    color: #4d554f;

    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;

    flex: 0 0 auto;

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


.editor-toolbar-select:hover {
    background: #f0f2f0;
    border-color: #e1e4e1;
    color: var(--editor-text);
}


.editor-toolbar-select:focus-visible {
    outline: 2px solid var(--editor-accent);
    outline-offset: 1px;
}


.editor-toolbar-select.is-active,
.editor-toolbar-select[aria-pressed="true"],
.editor-toolbar-select.active {
    background: #e8ebe8;
    border-color: #d4d9d4;
    color: var(--editor-text);

    font-weight: 700;
}


.editor-toolbar-size {
    min-width: 44px;

    justify-content: center;
}


.editor-heading-select {
    min-width: 38px;

    justify-content: center;

    font-size: 13px;
    font-weight: 700;
}


/* =========================================================
   16. COLOR TOOL
   ========================================================= */

.editor-color-button {
    flex-direction: column;
    gap: 1px;
}


.editor-color-line {
    display: block;

    width: 15px;
    height: 3px;
    margin-top: -2px;

    border-radius: 2px;

    background: currentColor;
}


/* =========================================================
   16b. COLOR SWATCH DROPDOWNS (text color / highlight)
   ========================================================= */

.editor-color-dropdown {
    min-width: 156px;
    padding: 8px;
}


.editor-color-swatches {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;

    padding: 2px;
}


.editor-color-swatch {
    width: 26px;
    height: 26px;
    padding: 0;

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

    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease;
}


.editor-color-swatch:hover {
    transform: scale(1.08);

    box-shadow: 0 0 0 2px var(--editor-focus);
}


.editor-color-swatch:focus-visible {
    outline: 2px solid var(--editor-accent);
    outline-offset: 1px;
}


.editor-color-dropdown button:not(.editor-color-swatch) {
    justify-content: center;

    color: var(--editor-text-soft);

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


/* =========================================================
   17. MORE TOOLS
   ========================================================= */

.editor-toolbar-more {
    width: 34px;

    flex-basis: 34px;
}


.editor-more-dots {
    display: block;

    color: currentColor;

    font-size: 13px;
    font-weight: 900;
    letter-spacing: 1px;
    line-height: 1;

    transform: translateY(-1px);
}


.editor-toolbar-group:last-child {
    position: relative;
}


/* =========================================================
   18. TIPTAP EDITOR AREA
   ========================================================= */

.tiptap-editor {
    min-height: 520px;
    padding: 28px 32px 34px;

    background: #ffffff;
    color: var(--editor-text);

    font-family: var(--editor-font);
    font-size: 16px;
    line-height: 1.75;

    outline: none;

    overflow-wrap: break-word;
    word-break: normal;
}


.tiptap-editor:focus {
    outline: none;
}


/*
 * The writing area itself (Tiptap's .ProseMirror element).
 * Browsers draw a black focus outline around it by default;
 * the whole card is the writing area, so none is needed.
 * The minimum height makes a click anywhere in the empty
 * space below the text place the cursor.
 */
.tiptap-editor .ProseMirror {
    min-height: 440px;

    outline: none;
}


.tiptap-editor .ProseMirror:focus,
.tiptap-editor .ProseMirror:focus-visible {
    outline: none;
}


/* =========================================================
   19. TIPTAP TYPOGRAPHY
   ========================================================= */

.tiptap-editor p {
    margin: 0 0 1.05em;
}


.tiptap-editor p:last-child {
    margin-bottom: 0;
}


.tiptap-editor h1,
.tiptap-editor h2,
.tiptap-editor h3,
.tiptap-editor h4 {
    margin-top: 1.5em;
    margin-bottom: 0.55em;

    color: var(--editor-text);

    font-weight: 750;
    line-height: 1.25;
    letter-spacing: -0.02em;
}


.tiptap-editor h1 {
    font-size: 31px;
}


.tiptap-editor h2 {
    font-size: 25px;
}


.tiptap-editor h3 {
    font-size: 21px;
}


.tiptap-editor h4 {
    font-size: 18px;
}


.tiptap-editor h1:first-child,
.tiptap-editor h2:first-child,
.tiptap-editor h3:first-child,
.tiptap-editor h4:first-child {
    margin-top: 0;
}


.tiptap-editor strong {
    font-weight: 750;
}


.tiptap-editor em {
    font-style: italic;
}


.tiptap-editor u {
    text-decoration-thickness: 1.5px;
    text-underline-offset: 2px;
}


.tiptap-editor s {
    text-decoration-thickness: 1.5px;
}


.tiptap-editor sup {
    vertical-align: super;
    font-size: 0.7em;
}


.tiptap-editor sub {
    vertical-align: sub;
    font-size: 0.7em;
}


/* =========================================================
   20. LINKS
   ========================================================= */

.tiptap-editor a {
    color: #9a6700;

    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;

    cursor: pointer;
}


.tiptap-editor a:hover {
    color: var(--editor-accent-dark);
}


/* =========================================================
   21. LISTS
   ========================================================= */

.tiptap-editor ul,
.tiptap-editor ol {
    margin: 0 0 1.05em;
    padding-left: 28px;
}


.tiptap-editor li {
    margin: 0.25em 0;
    padding-left: 4px;
}


.tiptap-editor li > p {
    margin: 0;
}


.tiptap-editor ul ul,
.tiptap-editor ol ol,
.tiptap-editor ul ol,
.tiptap-editor ol ul {
    margin-top: 0.3em;
    margin-bottom: 0.3em;
}


/* =========================================================
   22. TASK / CHECKLIST
   ========================================================= */

.tiptap-editor ul[data-type="taskList"] {
    list-style: none;
    padding-left: 0;
}


.tiptap-editor ul[data-type="taskList"] li {
    display: flex;
    align-items: flex-start;
    gap: 8px;

    padding-left: 0;
}


.tiptap-editor ul[data-type="taskList"] li > label {
    flex: 0 0 auto;

    margin-top: 5px;
}


.tiptap-editor ul[data-type="taskList"] li > label input {
    width: 15px;
    height: 15px;

    accent-color: var(--editor-accent);

    cursor: pointer;
}


.tiptap-editor ul[data-type="taskList"] li > div {
    flex: 1 1 auto;
}


/* =========================================================
   23. BLOCKQUOTE
   ========================================================= */

.tiptap-editor blockquote {
    margin: 1.25em 0;
    padding: 14px 18px;

    border-left: 4px solid var(--editor-accent);

    background: #faf8f1;
    color: #505650;

    font-size: 16px;
    font-style: italic;
}


.tiptap-editor blockquote p:last-child {
    margin-bottom: 0;
}


/* =========================================================
   24. CODE
   ========================================================= */

.tiptap-editor code {
    padding: 2px 5px;

    border-radius: 4px;

    background: #f0f1ef;
    color: #303631;

    font-family:
        "SFMono-Regular",
        Consolas,
        "Liberation Mono",
        monospace;
    font-size: 0.9em;
}


.tiptap-editor pre {
    margin: 1.25em 0;
    padding: 16px 18px;

    overflow-x: auto;

    border: 1px solid #dfe3df;
    border-radius: 7px;

    background: #202522;
    color: #f2f4f2;

    line-height: 1.55;
}


.tiptap-editor pre code {
    padding: 0;

    background: transparent;
    color: inherit;

    font-size: 13px;
    white-space: pre;
}


/* =========================================================
   25. HORIZONTAL RULE
   ========================================================= */

.tiptap-editor hr {
    margin: 28px 0;

    border: 0;
    border-top: 1px solid var(--editor-border-dark);
}


/* =========================================================
   26. IMAGES
   ========================================================= */

.tiptap-editor img {
    display: block;

    max-width: 100%;
    height: auto;
    margin: 20px auto;

    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(16, 24, 20, 0.08);

    cursor: default;
}


.tiptap-editor img.ProseMirror-selectednode {
    outline: 3px solid rgba(217, 154, 24, 0.5);
    outline-offset: 2px;
}


/* =========================================================
   27. IMAGE CAPTIONS
   ========================================================= */

.tiptap-editor figure {
    margin: 24px 0;
}


.tiptap-editor figure img {
    margin: 0 auto;
}


.tiptap-editor figcaption {
    margin-top: 7px;

    color: var(--editor-text-muted);

    font-size: 12px;
    line-height: 1.45;
    text-align: center;
}


/* =========================================================
   28–29. TABLES AND TEXT BOXES
   Styled in article-editor-blocks.css, together with the
   table tools and colour palettes.
   ========================================================= */


/* =========================================================
   30. VIDEO / EMBEDS
   ========================================================= */

.tiptap-editor iframe {
    display: block;

    width: 100%;
    max-width: 100%;
    min-height: 360px;
    margin: 22px auto;

    border: 0;
    border-radius: 7px;

    background: #111;
}


/* =========================================================
   31. EMPTY EDITOR PLACEHOLDER
   Reads the text from Tiptap's Placeholder extension.
   ========================================================= */

.tiptap-editor p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);

    float: left;
    height: 0;

    color: #a0a7a1;

    pointer-events: none;
}


/* =========================================================
   32. WRITING FOOTER
   ========================================================= */

.editor-writing-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;

    min-height: 44px;
    padding: 10px 20px;

    border-top: 1px solid var(--editor-border-light);

    background: #fbfcfb;
    color: var(--editor-text-muted);

    font-size: 11px;
}


.editor-autosave-status {
    min-width: 0;
}


#save-status {
    display: inline-block;

    white-space: nowrap;
}


.editor-counts {
    display: flex;
    align-items: center;
    gap: 18px;

    white-space: nowrap;
}


.editor-counts strong {
    color: var(--editor-text-soft);

    font-weight: 700;
}


/* =========================================================
   33. SIDEBAR CARDS
   ========================================================= */

.editor-sidebar-card {
    padding: 19px;

    background: #ffffff;
    border: 1px solid var(--editor-border);
    border-radius: var(--editor-radius);
    box-shadow: var(--editor-shadow-sm);
}


.editor-sidebar-card h2 {
    margin: 0;

    color: var(--editor-text);

    font-size: 15px;
    font-weight: 750;
    line-height: 1.3;
}


.editor-sidebar-card-description {
    margin: 5px 0 18px;

    color: var(--editor-text-muted);

    font-size: 12px;
    line-height: 1.45;
}


/* =========================================================
   34. FORM FIELDS
   ========================================================= */

.editor-field {
    margin-top: 15px;
}


.editor-field:first-child {
    margin-top: 0;
}


.editor-field label {
    display: block;
    margin-bottom: 6px;

    color: var(--editor-text-soft);

    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}


.editor-field input,
.editor-field textarea,
.editor-field select {
    display: block;

    width: 100%;

    border: 1px solid var(--editor-border-dark);
    border-radius: 6px;

    background: #ffffff;
    color: var(--editor-text);

    font-size: 13px;

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


.editor-field input,
.editor-field select {
    min-height: 38px;
    padding: 0 10px;
}


.editor-field textarea {
    min-height: 92px;
    padding: 9px 10px;

    resize: vertical;

    line-height: 1.5;
}


.editor-field input::placeholder,
.editor-field textarea::placeholder {
    color: #a0a7a1;
}


.editor-field input:focus,
.editor-field textarea:focus,
.editor-field select:focus {
    outline: none;

    border-color: var(--editor-accent);
    box-shadow: 0 0 0 3px var(--editor-focus);
}


.editor-field-help {
    margin: 5px 0 0;

    color: var(--editor-text-muted);

    font-size: 11px;
    line-height: 1.4;
}


/* Locked fields: writers' Schedule, set by
   configureScheduleUI() in article-editor.js */
.editor-field.is-disabled label {
    color: var(--editor-text-muted);
}


.editor-field input:disabled,
.editor-field select:disabled,
.editor-field textarea:disabled {
    background: var(--editor-surface-soft);
    color: var(--editor-text-muted);

    cursor: not-allowed;
}


/* =========================================================
   35. FEATURED IMAGE
   ========================================================= */

.editor-image-field-row {
    display: flex;
    gap: 8px;
}


.editor-image-field-row input {
    flex: 1 1 auto;
}


.editor-browse-button {
    flex: 0 0 auto;

    white-space: nowrap;
}


.featured-image-preview {
    display: none;

    margin-top: 10px;

    overflow: hidden;

    border: 1px solid var(--editor-border);
    border-radius: 6px;

    background: #f5f6f4;
}


.featured-image-preview:not(:empty) {
    display: block;
}


.featured-image-preview img {
    display: block;

    width: 100%;
    height: auto;
}


/* =========================================================
   36. STATUS / PUBLISHING
   ========================================================= */

.editor-status-field {
    margin-top: 0;
}


.editor-publishing-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;

    margin-top: 18px;
    padding-top: 16px;

    border-top: 1px solid var(--editor-border-light);
}


.editor-publishing-actions .editor-button {
    width: 100%;
}


/* =========================================================
   37. PREVIEW
   ========================================================= */

.editor-preview {
    position: fixed;
    inset: 0;
    z-index: 2000;

    overflow-y: auto;

    background: var(--editor-page-bg);
}


.preview-inner {
    width: min(900px, calc(100% - 40px));
    margin: 0 auto;
    padding: 48px 0 70px;
}


.editor-preview-heading {
    position: relative;

    margin-bottom: 30px;
    padding-right: 150px;
}


.editor-preview-heading h2 {
    margin: 0;

    color: var(--editor-text);

    font-size: 34px;
    line-height: 1.2;
    letter-spacing: -0.025em;
}


.editor-preview-close {
    position: absolute;
    top: 0;
    right: 0;
}


.editor-preview-content {
    padding: 36px;

    background: #ffffff;
    border: 1px solid var(--editor-border);
    border-radius: 8px;
    box-shadow: var(--editor-shadow-sm);

    color: var(--editor-text);

    font-size: 17px;
    line-height: 1.8;
}


.editor-preview-content img {
    display: block;

    max-width: 100%;
    height: auto;
    margin: 22px auto;
}


.editor-preview-content h1,
.editor-preview-content h2,
.editor-preview-content h3,
.editor-preview-content h4 {
    color: var(--editor-text);

    line-height: 1.25;
}


/* Stop the page behind the preview from scrolling */
body.editor-preview-open {
    overflow: hidden;
}


/* =========================================================
   38. LOADING / DISABLED STATES
   ========================================================= */

.is-loading {
    opacity: 0.65;

    pointer-events: none;
}


.editor-button:disabled,
.editor-toolbar-button:disabled,
.editor-toolbar-select:disabled,
.editor-menu-button:disabled {
    opacity: 0.45;

    pointer-events: none;
}


/* =========================================================
   39. REQUIRED FIELDS
   ========================================================= */

.editor-field input:required:invalid:not(:placeholder-shown),
.editor-field textarea:required:invalid:not(:placeholder-shown),
.editor-field select:required:invalid {
    border-color: rgba(180, 35, 24, 0.55);
}


.editor-field input:required:valid,
.editor-field textarea:required:valid {
    border-color: var(--editor-border-dark);
}


/* =========================================================
   40. FULLSCREEN EDITOR
   The page must stay scrollable here (no overflow: hidden
   on body), otherwise long articles can't be scrolled.
   The header is hidden, so the tools stick at the very top.
   ========================================================= */

body.editor-fullscreen {
    --editor-sticky-top: 0px;

    background: #ffffff;
}


body.editor-fullscreen .editor-header,
body.editor-fullscreen .editor-page-heading,
body.editor-fullscreen .editor-sidebar,
body.editor-fullscreen .editor-writing-footer {
    display: none;
}


body.editor-fullscreen .editor-page {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}


body.editor-fullscreen .article-editor-layout {
    display: block;
}


body.editor-fullscreen .editor-writing-card {
    min-height: 100vh;

    border: 0;
    border-radius: 0;
    box-shadow: none;
}


body.editor-fullscreen .editor-title-section {
    padding-left: max(28px, calc((100vw - 1100px) / 2));
    padding-right: max(28px, calc((100vw - 1100px) / 2));
}


body.editor-fullscreen .tiptap-editor {
    min-height: calc(100vh - 150px);

    padding-left: max(32px, calc((100vw - 1100px) / 2));
    padding-right: max(32px, calc((100vw - 1100px) / 2));
}


/* =========================================================
   41. TABLET
   ========================================================= */

@media (max-width: 1100px) {

    .article-editor-layout {
        grid-template-columns: minmax(0, 1fr) 290px;
        gap: 18px;
    }


    .editor-page,
    .editor-header-inner {
        width: min(var(--editor-content-width), calc(100% - 32px));
    }


    .tiptap-editor {
        padding-left: 24px;
        padding-right: 24px;
    }


    .editor-title-section {
        padding-left: 24px;
        padding-right: 24px;
    }


    .editor-toolbar {
        gap: 4px;
    }
}


/* =========================================================
   42. TABLET / NARROW
   Sidebar moves under the article and scrolls normally.
   ========================================================= */

@media (max-width: 900px) {

    .article-editor-layout {
        grid-template-columns: 1fr;
    }


    .editor-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }


    .editor-sidebar-card:last-child {
        grid-column: 1 / -1;
    }


    .editor-page {
        padding-top: 30px;
    }
}


/* =========================================================
   43. MOBILE
   ========================================================= */

@media (max-width: 680px) {

    .editor-header {
        height: auto;
        min-height: 60px;
    }


    .editor-header-inner {
        width: calc(100% - 24px);
        min-height: 60px;
        padding: 8px 0;
        gap: 12px;
    }


    .editor-header-left {
        gap: 10px;
    }


    .editor-back-link {
        padding: 0 6px;

        font-size: 12px;
    }


    .editor-logo {
        width: 31px;
        height: 31px;
    }


    .editor-brand-text strong {
        font-size: 11px;
    }


    .editor-brand-text span {
        font-size: 8px;
    }


    .editor-header-actions {
        gap: 5px;
    }


    .editor-header-actions .editor-button {
        min-height: 34px;
        padding: 0 10px;

        font-size: 11px;
    }


    .editor-page {
        width: calc(100% - 20px);
        padding: 22px 0 40px;
    }


    .editor-page-heading {
        margin-bottom: 18px;
    }


    .editor-page-heading h1 {
        font-size: 25px;
    }


    .article-editor-layout {
        gap: 14px;
    }


    .editor-title-section {
        padding: 18px 17px 14px;
    }


    #article-title {
        min-height: 46px;

        font-size: 24px;
    }


    .editor-menu-bar {
        padding-left: 7px;
        padding-right: 7px;

        overflow-x: auto;
        scrollbar-width: none;
    }


    .editor-menu-bar::-webkit-scrollbar {
        display: none;
    }


    .editor-menu-button {
        padding-left: 8px;
        padding-right: 8px;

        font-size: 11px;
    }


    .editor-toolbar {
        padding: 5px 7px;

        overflow-x: auto;
        overflow-y: visible;

        -webkit-overflow-scrolling: touch;
    }


    .editor-toolbar-button {
        width: 31px;
        height: 31px;

        flex-basis: 31px;
    }


    .editor-toolbar-button svg {
        width: 16px;
        height: 16px;
    }


    .editor-toolbar-select {
        height: 31px;
        min-width: 76px;
        padding-left: 8px;
        padding-right: 8px;

        font-size: 11px;
    }


    .editor-toolbar-size {
        min-width: 40px;
    }


    .editor-heading-select {
        min-width: 35px;
    }


    .editor-toolbar-divider {
        height: 22px;
        margin-left: 2px;
        margin-right: 2px;
    }


    .tiptap-editor {
        min-height: 460px;
        padding: 22px 18px 28px;

        font-size: 15.5px;
        line-height: 1.72;
    }


    .tiptap-editor h1 {
        font-size: 27px;
    }


    .tiptap-editor h2 {
        font-size: 23px;
    }


    .tiptap-editor h3 {
        font-size: 20px;
    }


    .tiptap-editor h4 {
        font-size: 17px;
    }


    .editor-writing-footer {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;

        padding: 10px 14px;
    }


    .editor-counts {
        width: 100%;

        justify-content: space-between;
        gap: 10px;
    }


    .editor-sidebar {
        grid-template-columns: 1fr;
        gap: 14px;
    }


    .editor-sidebar-card:last-child {
        grid-column: auto;
    }


    .editor-sidebar-card {
        padding: 16px;
    }


    .editor-preview-content {
        padding: 22px;

        font-size: 16px;
    }


    .preview-inner {
        width: calc(100% - 20px);
        padding: 28px 0 40px;
    }


    .editor-preview-heading {
        padding-right: 0;
        padding-top: 46px;
    }


    .editor-preview-close {
        top: 0;
        right: 0;
    }
}


/* =========================================================
   44. SMALL MOBILE
   ========================================================= */

@media (max-width: 440px) {

    .editor-header-inner {
        width: calc(100% - 16px);
        gap: 8px;
    }


    .editor-back-link {
        font-size: 11px;
    }


    .editor-brand {
        gap: 6px;
    }


    .editor-header-actions .editor-button {
        padding: 0 8px;

        font-size: 10px;
    }


    .editor-page {
        width: calc(100% - 14px);
    }


    .editor-title-section {
        padding-left: 14px;
        padding-right: 14px;
    }


    #article-title {
        font-size: 22px;
    }


    .tiptap-editor {
        padding-left: 14px;
        padding-right: 14px;
    }


    .editor-toolbar {
        padding-left: 5px;
        padding-right: 5px;
    }


    .editor-toolbar-divider {
        margin-left: 1px;
        margin-right: 1px;
    }


    .editor-toolbar-select {
        min-width: 70px;
    }


    .editor-preview-heading h2 {
        font-size: 27px;
    }


    .editor-preview-content {
        padding: 18px;
    }
}


/* =========================================================
   45. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;

        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}


/* =========================================================
   46. IMAGES IN THE EDITOR
   Each image sits in a .editor-image wrapper (created by
   article-editor-images.js) that carries its width and
   alignment. Selecting it shows the resize handles and the
   image toolbar.
   ========================================================= */

.tiptap-editor .editor-image {
    position: relative;

    display: block;

    max-width: 100%;
    margin: 20px auto;

    line-height: 0;
}


.tiptap-editor .editor-image img {
    display: block;

    width: 100%;
    height: auto;
    margin: 0;
}


.tiptap-editor .editor-image[data-align="left"] {
    float: left;

    margin: 6px 22px 14px 0;
}


.tiptap-editor .editor-image[data-align="right"] {
    float: right;

    margin: 6px 0 14px 22px;
}


/* Text below floated images starts on a clean line */
.tiptap-editor .ProseMirror::after {
    content: "";

    display: block;

    clear: both;
}


.tiptap-editor h1,
.tiptap-editor h2,
.tiptap-editor h3,
.tiptap-editor h4,
.tiptap-editor hr,
.tiptap-editor .tableWrapper {
    clear: both;
}


.tiptap-editor .editor-image.ProseMirror-selectednode img {
    outline: 3px solid rgba(217, 154, 24, 0.6);
    outline-offset: 2px;
}


/* Resize handles (bottom corners) */
.editor-image-resize {
    position: absolute;
    bottom: -7px;
    z-index: 2;

    display: none;

    width: 14px;
    height: 14px;

    background: #ffffff;

    border: 2px solid var(--editor-accent);
    border-radius: 3px;

    box-shadow: 0 1px 3px rgba(16, 24, 20, 0.25);

    touch-action: none;
}


.editor-image-resize[data-side="left"] {
    left: -7px;

    cursor: nesw-resize;
}


.editor-image-resize[data-side="right"] {
    right: -7px;

    cursor: nwse-resize;
}


.editor-image.ProseMirror-selectednode .editor-image-resize,
.editor-image.is-resizing .editor-image-resize {
    display: block;
}


/* Live size shown while dragging */
.editor-image-size-badge {
    position: absolute;
    top: 8px;
    right: 8px;

    display: none;

    padding: 4px 8px;

    background: rgba(17, 21, 18, 0.82);

    border-radius: 4px;

    color: #ffffff;

    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}


.editor-image.is-resizing .editor-image-size-badge {
    display: block;
}


/* Aligned images in the article preview */
.editor-preview-content img[data-align="left"] {
    float: left;

    margin: 6px 22px 14px 0;
}


.editor-preview-content img[data-align="right"] {
    float: right;

    margin: 6px 0 14px 22px;
}


.editor-preview-content h1,
.editor-preview-content h2,
.editor-preview-content h3,
.editor-preview-content h4 {
    clear: both;
}


@media (max-width: 680px) {

    /* On phones, side-by-side text is too narrow: stack instead */
    .tiptap-editor .editor-image[data-align="left"],
    .tiptap-editor .editor-image[data-align="right"],
    .editor-preview-content img[data-align="left"],
    .editor-preview-content img[data-align="right"] {
        float: none;

        margin: 16px auto;
    }


    .tiptap-editor .editor-image {
        min-width: 60%;
    }

}


/* =========================================================
   47. IMAGE TOOLBAR
   Floats above the selected image.
   ========================================================= */

.editor-image-toolbar {
    position: fixed;
    z-index: 950;

    display: flex;
    align-items: center;
    gap: 2px;

    max-width: calc(100vw - 16px);
    padding: 4px;

    overflow-x: auto;

    background: #111512;

    border-radius: 8px;

    box-shadow:
        0 10px 26px rgba(16, 24, 20, 0.25),
        0 2px 6px rgba(16, 24, 20, 0.15);

    scrollbar-width: none;
}


.editor-image-toolbar::-webkit-scrollbar {
    display: none;
}


.editor-image-toolbar-group {
    display: flex;
    align-items: center;
    gap: 2px;

    flex: 0 0 auto;
}


.editor-image-toolbar button {
    display: inline-flex;
    align-items: center;
    gap: 5px;

    min-height: 30px;
    padding: 0 9px;

    flex: 0 0 auto;

    background: transparent;

    border: 0;
    border-radius: 5px;

    color: #e9ece9;

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

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


.editor-image-toolbar button.is-icon {
    width: 30px;
    padding: 0;

    justify-content: center;
}


.editor-image-toolbar button svg {
    width: 16px;
    height: 16px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}


.editor-image-toolbar button:hover {
    background: rgba(255, 255, 255, 0.12);

    color: #ffffff;
}


.editor-image-toolbar button.is-active {
    background: var(--editor-accent);

    color: #111512;
}


.editor-image-toolbar button.is-danger:hover {
    background: var(--editor-danger);

    color: #ffffff;
}


.editor-image-toolbar button:focus-visible {
    outline: 2px solid var(--editor-accent);
    outline-offset: 1px;
}


.editor-image-toolbar-divider {
    width: 1px;
    height: 20px;
    margin: 0 3px;

    flex: 0 0 auto;

    background: rgba(255, 255, 255, 0.2);
}


@media (max-width: 680px) {

    /* Icons only on phones to save space */
    .editor-image-toolbar button span {
        display: none;
    }

}


/* =========================================================
   48. CROP DIALOG
   ========================================================= */

body.editor-crop-open {
    overflow: hidden;
}


.editor-crop-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;

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

    padding: 16px;

    background: rgba(17, 21, 18, 0.6);
}


.editor-crop-dialog {
    width: min(920px, 100%);
    max-height: calc(100vh - 32px);

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

    padding: 20px;

    overflow-y: auto;

    background: #ffffff;

    border-radius: 10px;

    box-shadow: 0 20px 50px rgba(16, 24, 20, 0.3);
}


.editor-crop-header h2 {
    margin: 0 0 4px;

    color: var(--editor-text);

    font-size: 19px;
    line-height: 1.3;
}


.editor-crop-header p {
    margin: 0;

    color: var(--editor-text-muted);

    font-size: 13px;
    line-height: 1.5;
}


.editor-crop-ratios {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}


.editor-crop-ratios button {
    min-height: 32px;
    padding: 0 13px;

    background: #ffffff;

    border: 1px solid var(--editor-border-dark);
    border-radius: 999px;

    color: var(--editor-text-soft);

    font-size: 12px;
    font-weight: 700;
}


.editor-crop-ratios button:hover {
    border-color: var(--editor-accent);

    color: var(--editor-text);
}


.editor-crop-ratios button.is-active {
    background: var(--editor-accent-soft);

    border-color: var(--editor-accent);

    color: var(--editor-accent-dark);
}


.editor-crop-stage {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 220px;
    padding: 14px;

    background: #1b1f1c;

    border-radius: 7px;
}


.editor-crop-loading {
    margin: 0;

    color: #c9cfca;

    font-size: 13px;
}


.editor-crop-frame {
    position: relative;

    display: inline-block;

    max-width: 100%;

    /* Clips the dark shade around the crop box */
    overflow: hidden;

    line-height: 0;

    user-select: none;
    -webkit-user-select: none;
}


.editor-crop-image {
    display: block;

    max-width: 100%;
    max-height: min(60vh, 560px);
    width: auto;
    height: auto;

    pointer-events: none;
}


.editor-crop-box {
    position: absolute;

    border: 2px solid #ffffff;

    /* Darkens everything outside the crop area */
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);

    cursor: move;

    touch-action: none;
}


/* Rule-of-thirds guides */
.editor-crop-box::before,
.editor-crop-box::after {
    content: "";

    position: absolute;
    inset: 0;

    pointer-events: none;
}


.editor-crop-box::before {
    border-left: 1px solid rgba(255, 255, 255, 0.35);
    border-right: 1px solid rgba(255, 255, 255, 0.35);

    left: 33.33%;
    right: 33.33%;
}


.editor-crop-box::after {
    border-top: 1px solid rgba(255, 255, 255, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.35);

    top: 33.33%;
    bottom: 33.33%;
}


.editor-crop-handle {
    position: absolute;
    z-index: 1;

    width: 16px;
    height: 16px;

    background: #ffffff;

    border: 2px solid var(--editor-accent);
    border-radius: 3px;

    touch-action: none;
}


.editor-crop-handle[data-crop-handle="nw"] { top: -8px; left: -8px; cursor: nwse-resize; }
.editor-crop-handle[data-crop-handle="ne"] { top: -8px; right: -8px; cursor: nesw-resize; }
.editor-crop-handle[data-crop-handle="sw"] { bottom: -8px; left: -8px; cursor: nesw-resize; }
.editor-crop-handle[data-crop-handle="se"] { bottom: -8px; right: -8px; cursor: nwse-resize; }


.editor-crop-error {
    margin: 0;

    padding: 10px 12px;

    background: rgba(180, 35, 24, 0.06);

    border: 1px solid rgba(180, 35, 24, 0.25);
    border-radius: 6px;

    color: var(--editor-danger);

    font-size: 13px;
    line-height: 1.45;
}


.editor-crop-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}


@media (max-width: 680px) {

    .editor-crop-dialog {
        padding: 16px;
    }


    .editor-crop-actions .editor-button {
        flex: 1 1 0;
    }


    /* Bigger touch targets for corners */
    .editor-crop-handle {
        width: 22px;
        height: 22px;
    }


    .editor-crop-handle[data-crop-handle="nw"] { top: -11px; left: -11px; }
    .editor-crop-handle[data-crop-handle="ne"] { top: -11px; right: -11px; }
    .editor-crop-handle[data-crop-handle="sw"] { bottom: -11px; left: -11px; }
    .editor-crop-handle[data-crop-handle="se"] { bottom: -11px; right: -11px; }

}
