.editor-color {
    color: inherit;
}

/* Shared by saved sliders, editor previews and public articles. Keep the
   original link text for assistive technology; draw font-independent arrows. */
.editor-slider .editor-slider-head {
    align-items: center;
    gap: 16px;
}

.editor-slider .editor-slider-title {
    min-width: 0;
}

.editor-slider .editor-slider-controls {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.editor-slider .editor-slider-controls > :is(.editor-slider-prev, .editor-slider-next) {
    --slider-control-ink: #2c3c18;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    box-sizing: border-box;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    margin: 0;
    border: 1px solid #d6dfd0;
    border-radius: 50%;
    background: #fff;
    color: var(--slider-control-ink);
    font-size: 0;
    line-height: 0;
    text-decoration: none;
    box-shadow: none;
    cursor: pointer;
    touch-action: manipulation;
    transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.editor-slider .editor-slider-controls > :is(.editor-slider-prev, .editor-slider-next)::before {
    content: "";
    display: block;
    width: 22px;
    height: 22px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m8.5 5 7 7-7 7' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m8.5 5 7 7-7 7' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
}

.editor-slider .editor-slider-controls > .editor-slider-prev::before {
    transform: rotate(180deg);
}

@media (hover: hover) {
    .editor-slider .editor-slider-controls > :is(.editor-slider-prev, .editor-slider-next):hover:not(.pointer-events-none):not([aria-disabled="true"]) {
        background: #f0f5ec;
        border-color: #829b70;
    }
}

.editor-slider .editor-slider-controls > :is(.editor-slider-prev, .editor-slider-next):focus-visible {
    outline: 2px solid #006f43;
    outline-offset: 3px;
}

.editor-slider .editor-slider-controls > :is(.editor-slider-prev, .editor-slider-next):active:not(.pointer-events-none):not([aria-disabled="true"]) {
    background: #e5eedf;
    border-color: #5c8429;
}

.editor-slider .editor-slider-controls > :is(.editor-slider-prev, .editor-slider-next):is(.pointer-events-none, [aria-disabled="true"]) {
    background: #f7f9f5;
    border-color: #e5eae1;
    color: #acb6a5;
    opacity: 1;
    cursor: default;
}

@media (prefers-reduced-motion: reduce) {
    .editor-slider .editor-slider-controls > :is(.editor-slider-prev, .editor-slider-next) {
        transition: none;
    }
}

.editor-slider .editor-slider-track { scrollbar-width: thin; scrollbar-color: #b5c2aa transparent; }
.editor-slider .editor-slider-track > .editor-slide { margin: 0; }
.editor-slider .editor-slide-image[role="button"] { cursor: zoom-in; }
.editor-slider .editor-slide-image[role="button"]:focus-visible { outline: 3px solid #006f43; outline-offset: -3px; }
.editor-gallery-dialog {
    box-sizing: border-box;
    width: min(1440px, calc(100vw - 32px));
    max-width: none;
    height: calc(100dvh - 32px);
    max-height: none;
    margin: auto;
    padding: 0;
    border: 1px solid #ffffff26;
    border-radius: 16px;
    background: #172019;
    color: #fff;
    font: 400 14px/1.45 system-ui, sans-serif;
    overflow: hidden;
    box-shadow: 0 24px 80px #0006;
}
.editor-gallery-dialog::backdrop { background: #09100dd9; }
.editor-gallery-dialog * { box-sizing: border-box; }
.editor-gallery-dialog [hidden] { display: none !important; }
.editor-gallery-layout { display: flex; flex-direction: column; height: 100%; }
.editor-gallery-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 20px; border-bottom: 1px solid #ffffff1f; }
.editor-gallery-info { min-width: 0; }
.editor-gallery-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 600; }
.editor-gallery-count { margin-top: 3px; color: #bac6b8; font-variant-numeric: tabular-nums; font-size: 13px; }
.editor-gallery-tools { display: flex; flex-shrink: 0; gap: 8px; }
.editor-gallery-button { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 1px solid #ffffff40; border-radius: 50%; background: #ffffff0a; color: #fff; cursor: pointer; touch-action: manipulation; }
.editor-gallery-button svg { display: block; width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.editor-gallery-button:hover:not(:disabled) { background: #ffffff20; border-color: #ffffff80; }
.editor-gallery-button:disabled { opacity: .3; cursor: default; }
.editor-gallery-button:focus-visible { outline: 2px solid #d2e7ba; outline-offset: 3px; }
.editor-gallery-body { position: relative; flex: 1; min-height: 0; }
.editor-gallery-stage { width: 100%; height: 100%; overflow: hidden; overscroll-behavior: contain; touch-action: pan-y pinch-zoom; scrollbar-width: thin; scrollbar-color: #82917f transparent; }
.editor-gallery-stage.is-zoomed { overflow: auto; cursor: grab; touch-action: pan-x pan-y pinch-zoom; }
.editor-gallery-stage.is-dragging { cursor: grabbing; }
.editor-gallery-canvas { display: grid; place-items: center; min-width: 100%; min-height: 100%; }
.editor-gallery-photo { display: block; flex: none; max-width: none; max-height: none; object-fit: contain; margin: 0; user-select: none; -webkit-user-drag: none; }
.editor-gallery-message { position: absolute; inset: 0; display: grid; place-items: center; padding: 32px; text-align: center; color: #bac6b8; pointer-events: none; }
.editor-gallery-prev,.editor-gallery-next { position: absolute; top: 50%; transform: translateY(-50%); background: #172019d9; box-shadow: 0 2px 16px #0003; }
.editor-gallery-prev { left: 16px; }
.editor-gallery-next { right: 16px; }
.editor-gallery-footer { flex-shrink: 0; padding: 12px 20px 16px; text-align: center; }
.editor-gallery-caption { max-height: 64px; overflow: auto; margin: 0; font-size: 14px; color: #fff; }
@media (max-width: 600px) {
    .editor-gallery-dialog { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
    .editor-gallery-header { flex-wrap: wrap; gap: 12px; padding: max(12px, env(safe-area-inset-top)) 12px 12px; }
    .editor-gallery-info { flex: 1 1 100%; }
    .editor-gallery-title { font-size: 14px; }
    .editor-gallery-tools { width: 100%; }
    .editor-gallery-tools > :last-child { margin-left: auto; }
    .editor-gallery-prev { left: 8px; }
    .editor-gallery-next { right: 8px; }
    .editor-gallery-footer { padding: 10px 16px max(14px, env(safe-area-inset-bottom)); }
}

.editor-color-forest {
    color: #2c3c18 !important;
}

.editor-color-leaf {
    color: #5c8429 !important;
}

.editor-color-gold {
    color: #b7791f !important;
}

.editor-color-berry {
    color: #9f1239 !important;
}

.editor-color-sky {
    color: #2563eb !important;
}

.editor-color-slate {
    color: #334155 !important;
}

.editor-align-left {
    text-align: left;
}

.editor-align-center {
    text-align: center;
}

.editor-align-right {
    text-align: right;
}

.editor-variant-callout {
    padding: 12px 14px;
    border: 1px solid #d9e6c2;
    border-radius: 14px;
    background: #f6f9ee;
}

.editor-variant-citation {
    color: #1f2937;
    font-style: italic;
}

.editor-variant-details {
    color: #374151;
    font-size: 0.92em;
}

.editor-raw-html {
    display: contents;
}

.cdx-tooltip {
    cursor: help;
    text-decoration: none;
    border-bottom: 1px dotted rgba(44, 60, 24, 0.45);
}

.editor-attach {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 16px 0;
    padding: 16px 18px;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.editor-attach-main {
    min-width: 0;
    flex: 1 1 260px;
}

.editor-attach-name {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    word-break: break-word;
}

.editor-attach-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
    font-size: 13px;
    color: #64748b;
}

.editor-attach-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    background: #2c3c18;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.editor-attach-link:hover {
    background: #243114;
    transform: translateY(-1px);
}

.editor-social {
    margin: 16px 0;
    padding: 16px 18px;
    border: 1px solid #d1d5db;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

.editor-social-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.editor-social-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.editor-social-note {
    font-size: 14px;
    color: #475569;
}

.editor-social-runtime {
    min-height: 24px;
    margin-top: 14px;
}

.editor-social-runtime iframe {
    display: block;
    width: 100%;
    max-width: 100%;
    border: 0;
}

.editor-social-fallback {
    margin-top: 14px;
}

.editor-social-fallback.is-hidden {
    display: none;
}

.editor-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #fff;
    color: #0f172a;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}

.editor-social-link:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    transform: translateY(-1px);
}
