/* Wicked Merge - Dark Theme with Orange Accent (#e25b2b) */

:root {
    --wc-orange: #e25b2b;
    --wc-orange-light: #f0845f;
    --wc-orange-dark: #c44820;
    --wc-orange-glow: rgba(226, 91, 43, 0.15);
    --wc-dark: #0f1117;
    --wc-dark-card: #181b23;
    --wc-dark-surface: #1e2130;
    --wc-dark-border: #2a2d3a;
    --wc-dark-hover: #252838;
    --wc-text: #e4e5eb;
    --wc-text-muted: #8b8fa3;
    --wc-text-dim: #5c6072;
}

/* ======= BASE ======= */
body {
    background: var(--wc-dark);
    color: var(--wc-text);
}

/* ======= TOP NAVIGATION ======= */
.top-nav {
    background: var(--wc-dark-card);
    border-bottom: 1px solid var(--wc-dark-border);
    backdrop-filter: blur(12px);
}
.top-nav a.nav-link {
    color: var(--wc-text-muted);
    transition: color 0.2s, background 0.2s;
    border-radius: 0.5rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
}
.top-nav a.nav-link:hover { color: #fff; background: var(--wc-dark-hover); }
.top-nav a.nav-link.active { color: var(--wc-orange); background: var(--wc-orange-glow); }
.top-nav .logo-img { height: 32px; width: auto; }
.top-nav .sign-out { color: var(--wc-text-dim); font-size: 0.8125rem; }
.top-nav .sign-out:hover { color: var(--wc-orange-light); }

/* ======= CARDS ======= */
.card {
    background: var(--wc-dark-card);
    border: 1px solid var(--wc-dark-border);
    border-radius: 0.75rem;
    transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
}
.card:hover {
    border-color: rgba(226, 91, 43, 0.4);
    box-shadow: 0 0 20px rgba(226, 91, 43, 0.08);
    transform: translateY(-2px);
}
.card-primary {
    border: 2px solid var(--wc-orange);
    background: linear-gradient(135deg, var(--wc-dark-card) 0%, rgba(226, 91, 43, 0.06) 100%);
}
.card-primary:hover {
    box-shadow: 0 0 30px rgba(226, 91, 43, 0.15);
}

/* ======= BUTTONS ======= */
.btn-primary {
    background: var(--wc-orange);
    color: #fff;
    font-weight: 600;
    border-radius: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-primary:hover { background: var(--wc-orange-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(226, 91, 43, 0.3); }
.btn-secondary {
    background: var(--wc-dark-surface);
    color: var(--wc-text);
    font-weight: 500;
    border-radius: 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    border: 1px solid var(--wc-dark-border);
    transition: all 0.2s;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}
.btn-secondary:hover { border-color: var(--wc-orange); color: var(--wc-orange-light); }
.btn-secondary.active { background: var(--wc-orange-glow); border-color: var(--wc-orange); color: var(--wc-orange); }

/* ======= STAT CARDS ======= */
.stat-number { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-number.orange { color: var(--wc-orange); }
.stat-number.green { color: #34d399; }
.stat-number.blue { color: #60a5fa; }
.stat-label { color: var(--wc-text-muted); font-size: 0.8125rem; margin-top: 0.25rem; }

/* ======= SIDEBAR ======= */
.sidebar {
    background: var(--wc-dark-card);
    border-right: 1px solid var(--wc-dark-border);
}
.nav-tree a {
    display: block;
    padding: 0.375rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.8125rem;
    color: var(--wc-text-muted);
    text-decoration: none;
    transition: all 0.15s;
}
.nav-tree a:hover { background: var(--wc-dark-hover); color: var(--wc-text); }
.nav-tree a.active { background: var(--wc-orange-glow); color: var(--wc-orange); font-weight: 600; }
.nav-tree .section-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--wc-text-dim);
    padding: 0.75rem 0.75rem 0.375rem;
}

/* ======= CONTENT BODY ======= */
.content-body { color: var(--wc-text); }
.content-body h1 { font-size: 1.875rem; font-weight: 700; margin-top: 1.5rem; margin-bottom: 0.75rem; line-height: 1.3; color: #fff; }
.content-body h2 { font-size: 1.5rem; font-weight: 600; margin-top: 2rem; margin-bottom: 0.5rem; line-height: 1.35; color: #fff; border-bottom: 1px solid var(--wc-dark-border); padding-bottom: 0.5rem; }
.content-body h3 { font-size: 1.25rem; font-weight: 600; margin-top: 1.25rem; margin-bottom: 0.5rem; line-height: 1.4; color: var(--wc-orange-light); }
.content-body h4 { font-size: 1.125rem; font-weight: 600; margin-top: 1rem; margin-bottom: 0.5rem; color: var(--wc-text); }
.content-body p { margin-bottom: 1rem; line-height: 1.75; color: var(--wc-text-muted); }
.content-body ul, .content-body ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.content-body ul { list-style-type: disc; }
.content-body ol { list-style-type: decimal; }
.content-body li { margin-bottom: 0.375rem; line-height: 1.65; color: var(--wc-text-muted); }
.content-body li strong { color: var(--wc-text); }
.content-body a { color: var(--wc-orange); text-decoration: none; border-bottom: 1px solid rgba(226, 91, 43, 0.3); transition: border-color 0.2s; }
.content-body a:hover { border-color: var(--wc-orange); }
.content-body img { max-width: 100%; height: auto; border-radius: 0.5rem; margin: 1rem 0; }
.content-body table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.content-body th, .content-body td { border: 1px solid var(--wc-dark-border); padding: 0.625rem 0.875rem; text-align: left; }
.content-body th { background: var(--wc-dark-surface); font-weight: 600; color: #fff; }
.content-body td { color: var(--wc-text-muted); }
.content-body blockquote { border-left: 3px solid var(--wc-orange); padding-left: 1rem; margin: 1.5rem 0; color: var(--wc-text-muted); font-style: italic; background: var(--wc-dark-surface); padding: 1rem 1.25rem; border-radius: 0 0.5rem 0.5rem 0; }
.content-body hr { border: none; border-top: 1px solid var(--wc-dark-border); margin: 2rem 0; }
.content-body strong { font-weight: 600; color: var(--wc-text); }

/* ======= BLUEPRINT BLOCKS ======= */
.blueprint-block {
    border: 1px dashed var(--wc-dark-border);
    border-left: 3px solid var(--wc-orange);
    border-radius: 0 0.5rem 0.5rem 0;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: var(--wc-dark-surface);
}
.blueprint-block .block-label {
    font-size: 0.6875rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--wc-orange);
    margin-bottom: 0.5rem;
}
.blueprint-block .text-sm { color: var(--wc-text-muted); }

/* ======= EDITORIAL NOTES ======= */
.editorial-note {
    background: rgba(226, 91, 43, 0.06);
    border: 1px solid rgba(226, 91, 43, 0.2);
    border-radius: 0.5rem;
    padding: 0.875rem 1.125rem;
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
}
.editorial-note .note-label {
    font-weight: 700;
    color: var(--wc-orange);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.editorial-note p { color: var(--wc-text-muted); }

/* ======= SOURCE BADGES ======= */
.badge-eu { background: rgba(52, 211, 153, 0.12); color: #34d399; border: 1px solid rgba(52, 211, 153, 0.2); }
.badge-uk { background: rgba(96, 165, 250, 0.12); color: #60a5fa; border: 1px solid rgba(96, 165, 250, 0.2); }
.badge-merged { background: rgba(251, 191, 36, 0.12); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.2); }
.badge-new { background: rgba(226, 91, 43, 0.12); color: var(--wc-orange-light); border: 1px solid rgba(226, 91, 43, 0.2); }
.badge-remove { background: rgba(248, 113, 113, 0.12); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.2); }

/* ======= COMPARISON PANELS ======= */
.panel-eu {
    background: rgba(52, 211, 153, 0.04);
    border: 1px solid rgba(52, 211, 153, 0.15);
    border-radius: 0.75rem;
}
.panel-eu .content-body { background: var(--wc-dark-card); border-radius: 0.5rem; padding: 1.5rem; border: 1px solid rgba(52, 211, 153, 0.1); }
.panel-uk {
    background: rgba(96, 165, 250, 0.04);
    border: 1px solid rgba(96, 165, 250, 0.15);
    border-radius: 0.75rem;
}
.panel-uk .content-body { background: var(--wc-dark-card); border-radius: 0.5rem; padding: 1.5rem; border: 1px solid rgba(96, 165, 250, 0.1); }

/* ======= SEARCH BOX ======= */
.search-box {
    background: var(--wc-dark-surface);
    border: 1px solid var(--wc-dark-border);
    border-radius: 0.5rem;
    color: var(--wc-text);
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    transition: border-color 0.2s;
    width: 100%;
}
.search-box:focus { outline: none; border-color: var(--wc-orange); box-shadow: 0 0 0 2px var(--wc-orange-glow); }
.search-box::placeholder { color: var(--wc-text-dim); }

/* ======= PAGE META HEADER ======= */
.page-meta { border-bottom: 1px solid var(--wc-dark-border); }
.page-meta .slug { color: var(--wc-text-dim); font-family: ui-monospace, monospace; font-size: 0.8125rem; }
.page-meta .meta-label { color: var(--wc-text-dim); font-weight: 600; font-size: 0.8125rem; }
.page-meta .meta-value { color: var(--wc-text-muted); font-size: 0.8125rem; }


/* ======= FOOTER ======= */
footer { background: var(--wc-dark-card); border-top: 1px solid var(--wc-dark-border); }
footer p { color: var(--wc-text-dim); }

/* ======= FORM ELEMENTS ======= */
input[type="text"], input[type="password"], input[type="email"], textarea, select {
    background: var(--wc-dark-surface);
    border: 1px solid var(--wc-dark-border);
    color: var(--wc-text);
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--wc-orange);
    box-shadow: 0 0 0 3px var(--wc-orange-glow);
}
label { color: var(--wc-text-muted); font-weight: 500; font-size: 0.875rem; }

/* ======= STRUCTURE PAGE DOTS ======= */
.dot-eu { background: #34d399; }
.dot-uk { background: #60a5fa; }
.dot-merged { background: #fbbf24; }
.dot-remove { background: #f87171; }
.dot-new { background: var(--wc-orange); }

/* ======= SCROLLBAR ======= */
.sidebar-scroll::-webkit-scrollbar { width: 4px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--wc-dark-border); border-radius: 2px; }
.sidebar-scroll::-webkit-scrollbar-thumb:hover { background: var(--wc-text-dim); }

/* ======= UTILITIES ======= */
[x-cloak] { display: none !important; }
.text-orange { color: var(--wc-orange) !important; }
.border-orange { border-color: var(--wc-orange) !important; }
.bg-dark-card { background: var(--wc-dark-card) !important; }
.bg-dark-surface { background: var(--wc-dark-surface) !important; }
.glow-orange { box-shadow: 0 0 20px rgba(226, 91, 43, 0.15); }

/* ======= TRANSITIONS ======= */
.transition-all { transition: all 0.25s ease; }

/* ======= PRINT ======= */
@media print {
    nav, footer, .no-print { display: none !important; }
    body { background: #fff; color: #000; }
    .content-body { max-width: 100% !important; color: #000; }
    .content-body h1, .content-body h2, .content-body h3 { color: #000; }
    .content-body p, .content-body li { color: #333; }
}

/* ======= REVISION SYSTEM ======= */
.revision-section {
    position: relative;
    border: 2px solid transparent;
    border-radius: 0.75rem;
    padding: 1.25rem 1.5rem;
    margin-bottom: 0.5rem;
    transition: border-color 0.2s, background 0.2s;
}
.revision-section:hover {
    border-color: rgba(226, 91, 43, 0.3);
    background: rgba(226, 91, 43, 0.02);
}
/* Section edit/remove buttons are now inline, no longer absolute */
.revision-section.has-revisions {
    border-color: rgba(251, 191, 36, 0.3);
}
.revision-section.has-revisions:hover {
    border-color: rgba(251, 191, 36, 0.5);
}
.revision-section.marked-remove {
    border-color: rgba(248, 113, 113, 0.3);
    background: rgba(248, 113, 113, 0.03);
}
.revision-section.marked-modify {
    border-color: rgba(96, 165, 250, 0.3);
    background: rgba(96, 165, 250, 0.03);
}
.revision-section.marked-add {
    border-color: rgba(52, 211, 153, 0.3);
    background: rgba(52, 211, 153, 0.03);
}
.revision-section .section-index {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    background: var(--wc-dark-surface);
    color: var(--wc-text-dim);
    border: 1px solid var(--wc-dark-border);
    white-space: nowrap;
}
.revision-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
}
.revision-badge.pending { background: rgba(251, 191, 36, 0.15); color: #fbbf24; }
.revision-badge.implemented { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.revision-badge.rejected { background: rgba(248, 113, 113, 0.15); color: #f87171; }

/* Revision modal */
.revision-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 100;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 5vh;
    overflow-y: auto;
}
.revision-modal {
    background: var(--wc-dark-card);
    border: 1px solid var(--wc-dark-border);
    border-radius: 1rem;
    width: 100%;
    max-width: 720px;
    margin-bottom: 5vh;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}
.revision-modal-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--wc-dark-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.revision-modal-body { padding: 1.5rem; }
.revision-modal-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--wc-dark-border);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Revision type selector */
.revision-type-option {
    border: 2px solid var(--wc-dark-border);
    border-radius: 0.625rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    transition: all 0.2s;
    background: transparent;
    text-align: left;
    width: 100%;
}
.revision-type-option:hover {
    border-color: var(--wc-text-dim);
}
.revision-type-option.selected-keep {
    border-color: #34d399;
    background: rgba(52, 211, 153, 0.06);
}
.revision-type-option.selected-modify {
    border-color: #60a5fa;
    background: rgba(96, 165, 250, 0.06);
}
.revision-type-option.selected-remove {
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.06);
}
.revision-type-option.selected-add_new {
    border-color: #a78bfa;
    background: rgba(167, 139, 250, 0.06);
}

/* User identity bar */
.user-identity-bar {
    background: var(--wc-dark-surface);
    border: 1px solid var(--wc-dark-border);
    border-radius: 0.75rem;
    padding: 0.75rem 1.25rem;
}
.user-identity-bar input {
    background: var(--wc-dark-card);
    border: 1px solid var(--wc-dark-border);
    border-radius: 0.375rem;
    color: var(--wc-text);
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}
.user-identity-bar input:focus {
    border-color: var(--wc-orange);
    outline: none;
}

/* Revision history panel */
.revision-history-item {
    background: var(--wc-dark-surface);
    border: 1px solid var(--wc-dark-border);
    border-radius: 0.5rem;
    padding: 0.875rem 1rem;
    transition: border-color 0.2s;
}
.revision-history-item:hover {
    border-color: var(--wc-text-dim);
}
.revision-type-tag {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
}
.revision-type-tag.type-keep { background: rgba(52, 211, 153, 0.15); color: #34d399; }
.revision-type-tag.type-modify { background: rgba(96, 165, 250, 0.15); color: #60a5fa; }
.revision-type-tag.type-remove { background: rgba(248, 113, 113, 0.15); color: #f87171; }
.revision-type-tag.type-add_new { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }

/* ======= DRAG & DROP ======= */
.revision-section.dragging {
    opacity: 0.4;
    border-color: var(--wc-orange) !important;
}
.revision-section.drag-over {
    border-color: var(--wc-orange) !important;
    background: rgba(226, 91, 43, 0.08) !important;
    box-shadow: 0 0 20px rgba(226, 91, 43, 0.15);
}
.drag-handle {
    cursor: grab;
    color: var(--wc-text-dim);
    transition: color 0.2s;
    padding: 0.25rem;
}
.drag-handle:hover { color: var(--wc-orange); }
.drag-handle:active { cursor: grabbing; }

/* ======= WYSIWYG EDITOR ======= */
.wysiwyg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.5rem;
    background: var(--wc-dark-surface);
    border-bottom: 1px solid var(--wc-dark-border);
    border-radius: 0.75rem 0.75rem 0 0;
}
.wysiwyg-toolbar button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 0.375rem;
    border: none;
    background: transparent;
    color: var(--wc-text-muted);
    cursor: pointer;
    transition: all 0.15s;
}
.wysiwyg-toolbar button:hover { background: var(--wc-dark-hover); color: #fff; }
.wysiwyg-toolbar button.is-active { background: var(--wc-orange-glow); color: var(--wc-orange); }
.wysiwyg-toolbar .toolbar-divider {
    width: 1px;
    height: 1.5rem;
    background: var(--wc-dark-border);
    margin: 0.25rem 0.25rem;
    align-self: center;
}
.wysiwyg-editor-wrap {
    border: 1px solid var(--wc-dark-border);
    border-radius: 0.75rem;
    background: var(--wc-dark-card);
    overflow: hidden;
}
.wysiwyg-editor-wrap .ProseMirror {
    padding: 1rem 1.25rem;
    min-height: 200px;
    max-height: 50vh;
    overflow-y: auto;
    outline: none;
    color: var(--wc-text);
    font-size: 0.875rem;
    line-height: 1.7;
}
.wysiwyg-editor-wrap .ProseMirror h1 { font-size: 1.5rem; font-weight: 700; color: #fff; margin: 1rem 0 0.5rem; }
.wysiwyg-editor-wrap .ProseMirror h2 { font-size: 1.25rem; font-weight: 600; color: #fff; margin: 0.875rem 0 0.5rem; border-bottom: 1px solid var(--wc-dark-border); padding-bottom: 0.375rem; }
.wysiwyg-editor-wrap .ProseMirror h3 { font-size: 1.125rem; font-weight: 600; color: var(--wc-orange-light); margin: 0.75rem 0 0.5rem; }
.wysiwyg-editor-wrap .ProseMirror p { margin-bottom: 0.75rem; color: var(--wc-text-muted); }
.wysiwyg-editor-wrap .ProseMirror ul { list-style: disc; padding-left: 1.5rem; margin-bottom: 0.75rem; }
.wysiwyg-editor-wrap .ProseMirror ol { list-style: decimal; padding-left: 1.5rem; margin-bottom: 0.75rem; }
.wysiwyg-editor-wrap .ProseMirror li { margin-bottom: 0.25rem; color: var(--wc-text-muted); }
.wysiwyg-editor-wrap .ProseMirror blockquote { border-left: 3px solid var(--wc-orange); padding-left: 1rem; color: var(--wc-text-muted); font-style: italic; margin: 0.75rem 0; }
.wysiwyg-editor-wrap .ProseMirror a { color: var(--wc-orange); text-decoration: underline; }
.wysiwyg-editor-wrap .ProseMirror mark { background: rgba(251, 191, 36, 0.3); color: #fff; border-radius: 2px; padding: 0 2px; }
.wysiwyg-editor-wrap .ProseMirror hr { border: none; border-top: 1px solid var(--wc-dark-border); margin: 1rem 0; }
.wysiwyg-editor-wrap .ProseMirror strong { color: var(--wc-text); font-weight: 600; }
.wysiwyg-editor-wrap .ProseMirror code { background: var(--wc-dark-surface); padding: 0.125rem 0.375rem; border-radius: 0.25rem; font-size: 0.8125rem; }
.wysiwyg-editor-wrap .ProseMirror img { max-width: 100%; border-radius: 0.5rem; margin: 0.5rem 0; }
.wysiwyg-editor-wrap .ProseMirror p.is-editor-empty:first-child::before {
    content: attr(data-placeholder);
    color: var(--wc-text-dim);
    pointer-events: none;
    float: left;
    height: 0;
}

/* Revision sidebar */
.revision-sidebar {
    background: var(--wc-dark-card);
    border-left: 1px solid var(--wc-dark-border);
    width: 320px;
    flex-shrink: 0;
    overflow-y: auto;
}
.revision-sidebar-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--wc-dark-border);
    transition: background 0.15s;
    cursor: pointer;
}
.revision-sidebar-item:hover { background: var(--wc-dark-hover); }
.revision-sidebar-item.active { background: var(--wc-orange-glow); border-left: 3px solid var(--wc-orange); }

/* Section action buttons are now inline in the header bar */

/* ======= SECTION COMMENTS ======= */
.section-comments {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: var(--wc-dark-surface);
    border: 1px solid var(--wc-dark-border);
    border-radius: 0.5rem;
}
.section-comment {
    padding: 0.5rem;
    border-radius: 0.375rem;
    margin-bottom: 0.375rem;
    background: rgba(30, 33, 48, 0.5);
    border-left: 2px solid #60a5fa;
}
.section-comment.resolved {
    opacity: 0.5;
    border-left-color: #34d399;
}

/* ======= GALLERY GRID ======= */
.wm-gallery {
    display: grid;
    gap: 0.5rem;
    margin: 1rem 0;
}
.wm-gallery-cols-1 { grid-template-columns: 1fr; }
.wm-gallery-cols-2 { grid-template-columns: repeat(2, 1fr); }
.wm-gallery-cols-3 { grid-template-columns: repeat(3, 1fr); }
.wm-gallery-cols-4 { grid-template-columns: repeat(4, 1fr); }
.wm-gallery-cols-5 { grid-template-columns: repeat(5, 1fr); }
.wm-gallery-item {
    overflow: hidden;
    border-radius: 0.375rem;
    border: 1px solid var(--wc-dark-border);
    background: var(--wc-dark-surface);
}
.wm-gallery-item a {
    display: block;
    line-height: 0;
}
.wm-gallery-item img {
    width: 100%;
    height: auto;
    object-fit: cover;
    aspect-ratio: 4/3;
    transition: transform 0.2s;
}
.wm-gallery-item:hover img {
    transform: scale(1.03);
}
.wm-gallery-item figcaption {
    padding: 0.375rem 0.5rem;
    font-size: 0.6875rem;
    color: var(--wc-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ======= TOGGLE BAR ======= */
.toggle-bar {
    background: var(--wc-dark-card);
    border-bottom: 1px solid var(--wc-dark-border);
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.25rem 1rem;
    position: sticky;
    top: 0;
    z-index: 20;
}
.toggle-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.toggle-item .toggle-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}
.toggle-item-label {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--wc-text-muted);
    transition: color 0.15s;
}
.toggle-item:hover .toggle-item-label { color: var(--wc-text); }
.toggle-switch {
    position: relative;
    width: 30px;
    height: 16px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}
.toggle-switch .toggle-track {
    position: absolute;
    inset: 0;
    background: var(--wc-dark-surface);
    border: 1px solid var(--wc-dark-border);
    border-radius: 8px;
    transition: background 0.2s, border-color 0.2s;
    cursor: pointer;
}
.toggle-switch .toggle-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    background: var(--wc-text-dim);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
}
.toggle-switch input:checked + .toggle-track {
    background: var(--wc-orange);
    border-color: var(--wc-orange);
}
.toggle-switch input:checked + .toggle-track::after {
    transform: translateX(14px);
    background: #fff;
}
.toggle-switch input:focus-visible + .toggle-track {
    box-shadow: 0 0 0 2px var(--wc-orange-glow);
}
.toggle-bar .toggle-sep {
    width: 1px;
    height: 16px;
    background: var(--wc-dark-border);
    flex-shrink: 0;
}
.toggle-bar .btn-edit {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 0.375rem;
    border: none;
    cursor: pointer;
    transition: background 0.15s, opacity 0.15s;
    background: var(--wc-orange);
    color: #fff;
    line-height: 1;
}
.toggle-bar .btn-edit:hover { opacity: 0.85; }
.toggle-bar .btn-edit svg { width: 12px; height: 12px; }

/* ======= DISCOVERY FORM ======= */
.discovery-radio:hover { border-color: rgba(226, 91, 43, 0.3); }
[x-cloak] { display: none !important; }

/* ======= RESPONSIVE ======= */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .revision-modal { margin: 1rem; max-width: calc(100% - 2rem); }
    .revision-sidebar { width: 100%; border-left: none; border-top: 1px solid var(--wc-dark-border); }
}
