/* Wiki News Overrides - Articles Grid & Category Filter */

/* ==================== Prevent horizontal scroll globally ==================== */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw;
    box-sizing: border-box;
}

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

main, #docs-section, #content-area {
    overflow-x: hidden;
    max-width: 100%;
}

/* Header mobile fixes */
header {
    flex-wrap: wrap;
    padding: 0.8em;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(85, 85, 85, 0.3);
    width: 100%;
}

.header-nav {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* Prevent horizontal scroll */
#editor-view {
    overflow-x: hidden;
    max-width: 100%;
}

#editor-view * {
    box-sizing: border-box;
}

/* Optimize content width for better readability */
#editor {
    max-width: 900px;
    margin: 0 auto;
}

#page-content {
    max-width: 900px;
    margin: 0 auto;
}

/* Images in editor and page content - optimized width */
#editor img,
#page-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1em auto;
    border-radius: 4px;
}

/* Prevent images from being too large */
#editor img[src*="attachments"],
#page-content img[src*="attachments"] {
    max-width: 100%;
    width: auto;
}

/* Header with category filter */
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(85, 85, 85, 0.3);
}

.category-filter-bar {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 15px 0;
    align-items: center;
}

/* New unified filter bar */
.filter-bar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 0;
    width: 100%;
}

.category-filters,
.status-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}

.category-btn {
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    color: #e0e0e0;
    background: rgba(50, 50, 50, 0.6);
    border: 1px solid rgba(85, 85, 85, 0.5);
    transition: all 0.2s ease;
    font-size: 0.9em;
    font-weight: 500;
}

.category-btn:hover {
    background: rgba(0, 123, 255, 0.2);
    border-color: rgba(0, 123, 255, 0.4);
}

.category-btn.active {
    background: rgba(0, 123, 255, 0.3);
    border-color: rgba(0, 123, 255, 0.6);
    color: white;
}

.new-article-btn {
    margin-left: auto;
    background: rgba(40, 167, 69, 0.2);
    border-color: rgba(40, 167, 69, 0.4);
}

.new-article-btn:hover {
    background: rgba(40, 167, 69, 0.3);
}

/* Status Filter (Admin) */
.status-filters {
    padding-top: 8px;
    border-top: 1px solid rgba(85, 85, 85, 0.2);
}

.filter-label {
    color: #aaa;
    font-size: 0.85em;
    font-weight: 500;
    white-space: nowrap;
    margin-right: 5px;
}

.status-btn {
    padding: 5px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: #e0e0e0;
    background: rgba(50, 50, 50, 0.5);
    border: 1px solid rgba(85, 85, 85, 0.4);
    transition: all 0.2s ease;
    font-size: 0.8em;
    font-weight: 500;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-btn:hover {
    background: rgba(0, 123, 255, 0.15);
    border-color: rgba(0, 123, 255, 0.3);
}

.status-btn.active {
    background: rgba(0, 123, 255, 0.25);
    border-color: rgba(0, 123, 255, 0.5);
    color: white;
}

.status-count {
    display: inline-block;
    padding: 1px 5px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    font-size: 0.75em;
    font-weight: 600;
    min-width: 16px;
    text-align: center;
    line-height: 1;
}

.status-btn.active .status-count {
    background: rgba(255, 255, 255, 0.25);
}

/* User greeting in header */
.user-greeting {
    color: #aaa;
    font-size: 0.9em;
    margin-right: 10px;
}

.header-nav {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-link {
    color: #e0e0e0;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.nav-link:hover {
    background: rgba(0, 123, 255, 0.2);
}

/* Articles Grid - hidden by default, shown via JS */
#articles-grid-view {
    display: none;
    width: 100%;
}

#articles-grid-view.show {
    display: block;
}

.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.article-card {
    background: rgba(30, 30, 30, 0.8);
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: #e0e0e0;
    border: 1px solid rgba(85, 85, 85, 0.5);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    border-color: rgba(0, 123, 255, 0.4);
}

.article-card-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.article-card-image-placeholder {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, rgba(50, 50, 50, 0.8) 0%, rgba(30, 30, 30, 0.8) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4em;
    color: rgba(200, 200, 200, 0.3);
}

.article-card-content {
    padding: 15px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.article-card-title {
    margin: 0 0 12px 0;
    font-size: 1.1em;
    color: #fff;
    line-height: 1.4;
}

.article-card-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.article-category,
.article-status {
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 600;
    text-transform: uppercase;
}

.category-news {
    background: rgba(0, 123, 255, 0.2);
    color: #64b5ff;
}

.category-press-kit {
    background: rgba(156, 39, 176, 0.2);
    color: #ce93d8;
}

.category-declassified {
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
}

.category-researcher_archive {
    background: rgba(0, 200, 170, 0.16);
    color: #7df7df;
}

.category-dossier {
    background: rgba(120, 170, 255, 0.16);
    color: #a9c8ff;
}

.status-draft {
    background: rgba(158, 158, 158, 0.2);
    color: #9e9e9e;
}

.status-pending {
    background: rgba(255, 193, 7, 0.2);
    color: #ffc107;
}

.status-published {
    background: rgba(40, 167, 69, 0.2);
    color: #4caf50;
}

.status-archived {
    background: rgba(97, 97, 97, 0.2);
    color: #616161;
}

.article-card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85em;
    color: rgba(200, 200, 200, 0.6);
}

.article-author,
.article-date {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* No articles */
.no-articles {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: rgba(200, 200, 200, 0.6);
}

.create-first-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 24px;
    background: rgba(0, 123, 255, 0.3);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    border: 1px solid rgba(0, 123, 255, 0.5);
    font-weight: 600;
    transition: all 0.2s ease;
}

.create-first-btn:hover {
    background: rgba(0, 123, 255, 0.4);
}

.researcher-archive-browser,
.researcher-article-shell {
    padding: 20px 0;
}

.researcher-archive-shell,
.researcher-article-terminal {
    background:
        linear-gradient(180deg, rgba(8, 24, 24, 0.96), rgba(3, 12, 12, 0.98)),
        radial-gradient(circle at top right, rgba(0, 255, 170, 0.08), transparent 40%);
    border: 1px solid rgba(85, 255, 210, 0.18);
    border-radius: 18px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    color: #d7fff5;
    overflow: hidden;
    position: relative;
}

.researcher-archive-shell::before,
.researcher-article-terminal::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        repeating-linear-gradient(
            180deg,
            rgba(170, 255, 235, 0.035) 0,
            rgba(170, 255, 235, 0.035) 1px,
            transparent 1px,
            transparent 4px
        );
    pointer-events: none;
    opacity: 0.45;
}

.researcher-archive-shell::after,
.researcher-article-terminal::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 20%, rgba(110, 255, 220, 0.06), transparent 26%),
        radial-gradient(circle at 80% 10%, rgba(110, 255, 220, 0.04), transparent 22%);
    mix-blend-mode: screen;
    pointer-events: none;
}

.researcher-archive-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(85, 255, 210, 0.16);
    background: rgba(2, 10, 10, 0.85);
    color: #8fffe8;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 0.85rem;
    font-family: "Consolas", "Lucida Console", "Courier New", monospace;
    position: relative;
    z-index: 1;
}

.researcher-archive-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #79f7df;
    box-shadow: 0 0 12px rgba(121, 247, 223, 0.8);
}

.researcher-archive-path,
.researcher-article-meta-line {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 20px 0;
    color: rgba(186, 255, 242, 0.74);
    font-size: 0.92rem;
    font-family: "Consolas", "Lucida Console", "Courier New", monospace;
    position: relative;
    z-index: 1;
    align-items: flex-start;
}

.researcher-archive-intro {
    padding: 16px 20px 8px;
    position: relative;
    z-index: 1;
}

.researcher-archive-intro h2,
.researcher-article-title {
    margin: 0 0 10px;
    color: #f1fffb;
    font-size: clamp(1.7rem, 2.4vw, 2.6rem);
}

.researcher-archive-intro p {
    margin: 0;
    color: rgba(214, 255, 248, 0.8);
    max-width: 720px;
    line-height: 1.7;
}

.researcher-archive-statusbar,
.researcher-file-classification {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    padding: 12px 20px 18px;
    position: relative;
    z-index: 1;
    font-family: "Consolas", "Lucida Console", "Courier New", monospace;
}

.researcher-archive-statusbar span,
.researcher-file-badge {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 12px;
    border-radius: 999px;
    border: 1px solid rgba(108, 255, 221, 0.18);
    background: rgba(6, 22, 22, 0.72);
    color: rgba(194, 255, 244, 0.88);
    letter-spacing: 0.04em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.researcher-archive-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.researcher-folder-card,
.researcher-file-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    border: 1px solid rgba(85, 255, 210, 0.14);
    background: rgba(10, 30, 30, 0.7);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.researcher-folder-card:hover,
.researcher-file-card:hover,
.researcher-archive-back:hover {
    transform: translateY(-2px);
    border-color: rgba(124, 255, 224, 0.4);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
}

.researcher-folder-card {
    flex-direction: column;
    align-items: flex-start;
    min-height: 170px;
}

.researcher-folder-card strong,
.researcher-file-body strong {
    color: #f3fffd;
    font-size: 1rem;
}

.researcher-folder-card small,
.researcher-file-body small,
.researcher-empty-state {
    color: rgba(195, 255, 245, 0.66);
}

.researcher-folder-icon,
.researcher-file-icon {
    position: relative;
    flex: 0 0 auto;
}

.researcher-folder-icon {
    width: 54px;
    height: 42px;
    border-radius: 10px;
    background: linear-gradient(180deg, #f3cf74, #bb8d28);
}

.researcher-folder-icon::before {
    content: "";
    position: absolute;
    top: -8px;
    left: 6px;
    width: 24px;
    height: 12px;
    border-radius: 8px 8px 0 0;
    background: #dfb457;
}

.researcher-file-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px;
    position: relative;
    z-index: 1;
}

.researcher-file-card {
    position: relative;
}

.researcher-file-card::after {
    content: "";
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 10px;
    height: 1px;
    background: linear-gradient(90deg, rgba(124, 255, 224, 0), rgba(124, 255, 224, 0.35), rgba(124, 255, 224, 0));
    opacity: 0;
    transition: opacity 0.2s ease;
}

.researcher-file-card:hover::after {
    opacity: 1;
}

.researcher-file-icon {
    width: 36px;
    height: 46px;
    border-radius: 6px;
    background: linear-gradient(180deg, #d8fff6, #92d8cb);
}

.researcher-file-icon::after {
    content: "TXT";
    position: absolute;
    bottom: 6px;
    left: 7px;
    font-size: 0.66rem;
    color: #06352e;
    font-weight: 700;
    letter-spacing: 0.08em;
}

.researcher-file-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.researcher-archive-actions {
    padding: 20px;
    position: relative;
    z-index: 1;
}

.researcher-archive-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 999px;
    border: 1px solid rgba(124, 255, 224, 0.18);
    color: #cafff5;
    background: rgba(10, 30, 30, 0.78);
    text-decoration: none;
    font-family: "Consolas", "Lucida Console", "Courier New", monospace;
}

.researcher-article-terminal {
    padding-bottom: 24px;
}

.researcher-article-meta-line {
    padding-top: 14px;
    margin-top: 4px;
}

.researcher-article-title {
    padding: 0 20px;
    margin-top: 16px;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 18px rgba(129, 255, 229, 0.12);
}

.researcher-article-kicker {
    padding: 8px 20px 0;
    color: rgba(160, 255, 236, 0.68);
    font-family: "Consolas", "Lucida Console", "Courier New", monospace;
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
}

.researcher-article-screen {
    margin: 16px 20px 20px;
    padding: 24px;
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(2, 10, 10, 0.94), rgba(8, 20, 20, 0.94)),
        repeating-linear-gradient(180deg, rgba(155, 255, 233, 0.03) 0 2px, transparent 2px 4px);
    border: 1px solid rgba(91, 255, 214, 0.12);
    color: #dffff8;
    line-height: 1.8;
    font-family: "Consolas", "Lucida Console", "Courier New", monospace;
    position: relative;
    z-index: 1;
    box-shadow:
        inset 0 0 0 1px rgba(140, 255, 229, 0.06),
        inset 0 0 28px rgba(92, 255, 209, 0.04);
}

.researcher-article-screen::before {
    content: "\0430\0440\0445\0438\0432\043d\0430\044f_\0437\0430\043f\0438\0441\044c.txt";
    display: block;
    margin-bottom: 16px;
    color: rgba(143, 255, 232, 0.7);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.researcher-article-screen::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(150, 255, 227, 0.025), transparent 14%, transparent 86%, rgba(150, 255, 227, 0.02));
    pointer-events: none;
}

.researcher-article-screen h1,
.researcher-article-screen h2,
.researcher-article-screen h3,
.researcher-article-screen h4,
.researcher-article-screen h5,
.researcher-article-screen h6,
.researcher-article-screen strong {
    color: #f4fffc;
}

.researcher-article-screen blockquote {
    margin: 1.2rem 0;
    padding: 0.9rem 1rem;
    border-left: 3px solid rgba(125, 247, 223, 0.55);
    background: rgba(24, 58, 58, 0.5);
}

.researcher-article-screen code {
    background: rgba(112, 255, 224, 0.1);
    border-radius: 6px;
    padding: 0.1rem 0.35rem;
}

.researcher-article-terminal > .related-game-box,
.researcher-article-terminal > .related-articles-box,
.dossier-article-main > .related-game-box,
.dossier-article-main > .related-articles-box {
    margin: 0 20px 20px;
    position: relative;
    z-index: 1;
}

.dossier-shell,
.dossier-article-terminal {
    background:
        linear-gradient(180deg, rgba(14, 18, 30, 0.97), rgba(7, 10, 18, 0.99)),
        radial-gradient(circle at top right, rgba(122, 174, 255, 0.12), transparent 42%);
    border-color: rgba(123, 173, 255, 0.24);
    color: #e5efff;
}

.dossier-shell::before,
.dossier-article-terminal::before {
    background:
        repeating-linear-gradient(
            180deg,
            rgba(188, 214, 255, 0.04) 0,
            rgba(188, 214, 255, 0.04) 1px,
            transparent 1px,
            transparent 4px
        );
}

.dossier-shell::after,
.dossier-article-terminal::after {
    background:
        radial-gradient(circle at 18% 18%, rgba(141, 185, 255, 0.08), transparent 26%),
        radial-gradient(circle at 82% 12%, rgba(141, 185, 255, 0.06), transparent 22%);
}

.dossier-toolbar {
    border-bottom-color: rgba(123, 173, 255, 0.2);
    background: rgba(7, 11, 20, 0.88);
    color: #cddfff;
}

.dossier-path,
.dossier-article-meta-line,
.dossier-intro p,
.dossier-article-kicker {
    color: rgba(214, 227, 255, 0.78);
}

.dossier-statusbar span,
.dossier-file-classification .researcher-file-badge {
    border-color: rgba(123, 173, 255, 0.24);
    background: rgba(16, 24, 42, 0.76);
    color: rgba(228, 238, 255, 0.9);
}

.dossier-folder-card,
.dossier-file-card,
.dossier-archive-back {
    border-color: rgba(123, 173, 255, 0.18);
    background: rgba(16, 24, 42, 0.72);
}

.dossier-folder-card:hover,
.dossier-file-card:hover,
.dossier-archive-back:hover {
    border-color: rgba(157, 195, 255, 0.44);
}

.dossier-folder-icon {
    background: linear-gradient(180deg, #8db5ff, #5278d3);
}

.dossier-folder-icon::before {
    background: #7299ef;
}

.dossier-file-icon {
    background: linear-gradient(180deg, #eef4ff, #bfd0f2);
}

.dossier-file-icon::after {
    content: "DOS";
    color: #173161;
}

.dossier-article-layout {
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.dossier-article-main {
    min-width: 0;
}

.dossier-header-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 210px;
    gap: 18px;
    align-items: center;
    margin-top: 16px;
    width: min(60%, 920px);
    max-width: 920px;
}

.dossier-header-text {
    min-width: 0;
    text-align: left;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.dossier-case-header {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 14px;
    align-items: start;
    margin-top: 0;
    padding: 14px 16px;
    border: 1px solid rgba(123, 173, 255, 0.18);
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(17, 23, 38, 0.92), rgba(12, 17, 29, 0.96)),
        radial-gradient(circle at top left, rgba(184, 211, 255, 0.08), transparent 48%);
    box-shadow: inset 0 0 0 1px rgba(210, 226, 255, 0.04);
    justify-items: start;
}

.dossier-case-stamp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    min-height: 92px;
    padding: 10px 12px;
    border: 1px solid rgba(168, 199, 255, 0.28);
    border-radius: 50%;
    color: rgba(227, 238, 255, 0.88);
    background: radial-gradient(circle, rgba(112, 148, 214, 0.18), rgba(52, 72, 112, 0.14));
    font-family: "Consolas", "Lucida Console", "Courier New", monospace;
    font-size: 0.92rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.dossier-case-stamp,
.dossier-photo-frame {
    flex-shrink: 0;
}

.dossier-case-lines {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.dossier-case-row {
    display: grid;
    grid-template-columns: minmax(120px, 170px) minmax(0, 1fr);
    gap: 12px;
    padding-bottom: 8px;
    border-bottom: 1px dashed rgba(168, 199, 255, 0.14);
}

.dossier-case-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.dossier-case-label {
    color: rgba(194, 212, 245, 0.76);
    font-size: 0.76rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-family: "Consolas", "Lucida Console", "Courier New", monospace;
}

.dossier-case-value {
    color: #edf4ff;
    font-size: 0.96rem;
}

.dossier-article-kicker {
    padding: 16px 0 0;
    margin: 0;
    font-family: "Consolas", "Lucida Console", "Courier New", monospace;
    font-size: 0.82rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-align: left;
}

.dossier-article-title {
    padding: 10px 0 0;
    margin-top: 0;
    margin-bottom: 0;
    text-align: left;
}

.dossier-article-screen {
    margin: 18px 0 0;
    padding: 28px 26px 26px;
    background:
        linear-gradient(180deg, rgba(14, 18, 28, 0.98), rgba(18, 24, 36, 0.98)),
        linear-gradient(90deg, rgba(232, 240, 255, 0.015), rgba(232, 240, 255, 0)),
        repeating-linear-gradient(180deg, rgba(188, 214, 255, 0.026) 0 2px, transparent 2px 4px);
    border-color: rgba(123, 173, 255, 0.16);
    color: #edf4ff;
    line-height: 1.85;
    box-shadow:
        inset 0 0 0 1px rgba(176, 205, 255, 0.05),
        inset 0 0 28px rgba(132, 176, 255, 0.05);
}

.dossier-article-terminal #page-content.dossier-article-screen {
    width: min(60%, 920px);
    max-width: 920px;
    margin-right: auto;
    margin-left: 0;
}

@media (max-width: 1279px) and (min-width: 980px) {
    .dossier-header-grid {
        width: min(72%, 900px);
        max-width: 900px;
        grid-template-columns: minmax(0, 1fr) 188px;
        gap: 14px;
    }

    .dossier-article-terminal #page-content.dossier-article-screen {
        width: min(72%, 900px);
        max-width: 900px;
    }

    .dossier-case-row {
        grid-template-columns: minmax(110px, 150px) minmax(0, 1fr);
        gap: 10px;
    }
}

@media (max-width: 979px) and (min-width: 769px) {
    .dossier-header-grid {
        width: min(88%, 780px);
        max-width: 780px;
        grid-template-columns: minmax(0, 1fr) 152px;
        gap: 12px;
    }

    .dossier-case-header {
        grid-template-columns: 72px minmax(0, 1fr);
        gap: 10px;
        padding: 12px 14px;
    }

    .dossier-case-stamp {
        min-width: 72px;
        min-height: 72px;
        font-size: 0.78rem;
        letter-spacing: 0.12em;
    }

    .dossier-case-row {
        grid-template-columns: minmax(92px, 126px) minmax(0, 1fr);
        gap: 8px;
        padding-bottom: 6px;
    }

    .dossier-case-label {
        font-size: 0.7rem;
        letter-spacing: 0.1em;
    }

    .dossier-case-value {
        font-size: 0.9rem;
    }

    .dossier-article-kicker {
        padding-top: 12px;
        font-size: 0.74rem;
        letter-spacing: 0.08em;
    }

    .dossier-article-title {
        font-size: clamp(1.45rem, 3vw, 1.9rem);
        line-height: 1.14;
    }

    .dossier-article-terminal #page-content.dossier-article-screen {
        width: min(88%, 780px);
        max-width: 780px;
        padding: 22px 20px 22px;
    }
}

.dossier-article-screen::before {
    content: "\0434\043e\0441\044c\0435_\043b\0438\0447\043d\043e\0433\043e_\0434\0435\043b\0430.txt";
    color: rgba(205, 223, 255, 0.72);
}

.dossier-photo-panel {
    width: 100%;
    margin: 0 0 18px;
    position: relative;
    z-index: 1;
}

.dossier-photo-frame {
    padding: 12px;
    border-radius: 16px;
    border: 1px solid rgba(123, 173, 255, 0.18);
    background:
        linear-gradient(180deg, rgba(20, 26, 40, 0.96), rgba(14, 19, 31, 0.98)),
        radial-gradient(circle at top, rgba(138, 182, 255, 0.1), transparent 58%);
    box-shadow:
        inset 0 0 0 1px rgba(180, 207, 255, 0.05),
        0 18px 34px rgba(0, 0, 0, 0.26);
}

.dossier-photo-caption {
    margin-bottom: 10px;
    color: rgba(219, 231, 255, 0.76);
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    text-align: center;
}

.dossier-photo-image,
.dossier-photo-placeholder {
    display: block;
    width: 100%;
    border-radius: 12px;
    aspect-ratio: 4 / 5;
}

.dossier-photo-image {
    object-fit: cover;
    border: 1px solid rgba(202, 221, 255, 0.1);
    filter: saturate(0.84) contrast(1.05) brightness(0.98);
}

.dossier-photo-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    background:
        linear-gradient(180deg, rgba(28, 37, 58, 0.94), rgba(16, 23, 38, 0.98)),
        repeating-linear-gradient(180deg, rgba(188, 214, 255, 0.03) 0 2px, transparent 2px 4px);
    color: rgba(220, 232, 255, 0.7);
    font-family: "Consolas", "Lucida Console", "Courier New", monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.dossier-article-screen > :not(.dossier-photo-panel):first-child {
    margin-top: 0;
}

.dossier-article-screen::after {
    content: "";
    display: block;
    clear: both;
}

#editor-researcher-folder-wrapper {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 220px;
}

#editor-researcher-folder {
    width: 100%;
}

@media (max-width: 768px) {
    .researcher-archive-browser,
    .researcher-article-shell {
        padding: 12px 0;
    }

    .researcher-archive-shell,
    .researcher-article-terminal {
        border-radius: 14px;
    }

    .dossier-article-shell {
        padding: 0;
    }

    .dossier-article-terminal {
        border-radius: 0;
        margin-left: -12px;
        margin-right: -12px;
    }

    .researcher-archive-toolbar,
    .researcher-archive-path,
    .researcher-archive-statusbar,
    .researcher-file-classification,
    .researcher-article-meta-line,
    .researcher-archive-intro,
    .researcher-archive-grid,
    .researcher-file-list,
    .researcher-archive-actions,
    .researcher-article-title,
    .researcher-article-kicker,
    .researcher-article-screen {
        padding-left: 14px;
        padding-right: 14px;
    }

    .researcher-archive-statusbar,
    .researcher-file-classification {
        padding-top: 10px;
        padding-bottom: 14px;
        gap: 8px;
    }

    .researcher-article-screen {
        margin: 14px;
        padding-top: 18px;
        padding-bottom: 18px;
    }

    .dossier-article-layout {
        padding-left: 0;
        padding-right: 0;
    }

    .dossier-header-grid {
        width: 100%;
        max-width: none;
        grid-template-columns: 1fr;
        gap: 14px;
        margin-top: 12px;
    }

    .dossier-case-header {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-top: 14px;
        padding: 12px;
    }

    .dossier-case-stamp {
        min-width: 0;
        width: 100%;
        min-height: 52px;
        border-radius: 14px;
        letter-spacing: 0.12em;
    }

    .dossier-case-row {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .dossier-photo-panel {
        width: 100%;
        max-width: none;
        margin: 0 0 16px;
    }

    .dossier-article-screen {
        width: 100%;
        max-width: none;
        margin: 14px 0 0;
        padding: 18px 14px 18px;
    }

    .dossier-article-terminal #page-content.dossier-article-screen {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    .dossier-article-kicker {
        padding-top: 12px;
        font-size: 0.75rem;
        letter-spacing: 0.08em;
    }

    .dossier-article-title {
        padding-top: 10px;
        font-size: clamp(1.55rem, 7vw, 2.1rem);
        line-height: 1.15;
    }

    .dossier-photo-frame {
        border-radius: 14px;
        padding: 10px;
    }

    .dossier-photo-image,
    .dossier-photo-placeholder {
        aspect-ratio: 16 / 10;
        border-radius: 10px;
    }

    .researcher-archive-actions {
        padding-top: 12px;
        margin-top: 8px;
    }

    .researcher-archive-back {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .researcher-archive-grid {
        grid-template-columns: 1fr;
    }

}

/* Document header - title and actions */
#document-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(85, 85, 85, 0.3);
    padding-bottom: 1em;
    margin-bottom: 1em;
}

#page-title {
    color: #fff;
    font-size: 2em;
    margin: 0;
    flex-grow: 1;
}

/* Document cover image container */
#document-cover-container {
    width: 100%;
    margin: 20px 0;
}

#document-cover-image {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

/* Document view meta - unified styling */
#page-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin: 15px 0;
    padding: 12px 16px;
    background: rgba(30, 30, 30, 0.5);
    border-radius: 8px;
    border: 1px solid rgba(85, 85, 85, 0.3);
}

#page-category,
#page-status,
#page-author,
#page-date {
    font-size: 0.9em;
    color: rgba(200, 200, 200, 0.8);
    padding: 4px 10px;
    border-radius: 6px;
    background: rgba(50, 50, 50, 0.4);
    border: 1px solid rgba(85, 85, 85, 0.2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

#page-category:hover,
#page-status:hover,
#page-author:hover,
#page-date:hover {
    background: rgba(50, 50, 50, 0.6);
    border-color: rgba(85, 85, 85, 0.4);
}

/* Editor category wrapper */
#editor-meta {
    display: flex;
    gap: 20px;
    margin: 15px 0;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
    max-width: 100%;
}

#editor-category-wrapper,
#editor-author-wrapper,
#editor-researcher-folder-wrapper,
#editor-cover-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

#editor-category-wrapper label,
#editor-author-wrapper label,
#editor-researcher-folder-wrapper label,
#editor-cover-wrapper label {
    color: #e0e0e0;
    font-weight: 500;
    white-space: nowrap;
}

#editor-category,
#editor-researcher-folder {
    padding: 8px 12px;
    background: rgba(50, 50, 50, 0.6);
    border: 1px solid rgba(85, 85, 85, 0.5);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.95em;
    max-width: 200px;
}

#editor-author-name {
    padding: 8px 12px;
    background: rgba(50, 50, 50, 0.6);
    border: 1px solid rgba(85, 85, 85, 0.5);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.95em;
    width: 200px;
}

#editor-dates-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

#editor-dates-wrapper label {
    color: #e0e0e0;
    font-weight: 500;
    white-space: nowrap;
}

.date-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-inputs input[type="datetime-local"] {
    padding: 8px 12px;
    background: rgba(50, 50, 50, 0.6);
    border: 1px solid rgba(85, 85, 85, 0.5);
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 0.85em;
    width: 160px;
}

.date-inputs input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    cursor: pointer;
}

.date-inputs span {
    color: #888;
}

#editor-cover-image {
    max-width: 150px;
    flex-shrink: 0;
}

/* Upload cover and remove cover buttons - override EVERYTHING */
body.dark-theme #upload-cover-button,
body #upload-cover-button,
body.dark-theme #remove-cover-button,
body #remove-cover-button,
#upload-cover-button,
#remove-cover-button {
    padding: 8px 16px !important;
    padding: 0.5em 1em !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    color: #e0e0e0 !important;
    background: rgba(50, 50, 50, 0.85) !important;
    background-image: none !important;
    border: 1px solid rgba(85, 85, 85, 0.6) !important;
    transition: all 0.2s ease !important;
    font-size: 0.9em !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    height: auto !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    transform: none !important;
    margin: 0 !important;
}

body.dark-theme #upload-cover-button,
body #upload-cover-button,
#upload-cover-button {
    background: rgba(0, 123, 255, 0.6) !important;
    background-image: none !important;
    border-color: rgba(0, 123, 255, 0.8) !important;
}

body.dark-theme #upload-cover-button:hover,
body #upload-cover-button:hover,
#upload-cover-button:hover {
    background: rgba(0, 123, 255, 0.8) !important;
    background-image: none !important;
    border-color: rgba(0, 123, 255, 1) !important;
}

body.dark-theme #remove-cover-button,
body #remove-cover-button,
#remove-cover-button {
    background: rgba(108, 117, 125, 0.6) !important;
    background-image: none !important;
    border-color: rgba(108, 117, 125, 0.8) !important;
}

body.dark-theme #remove-cover-button:hover,
body #remove-cover-button:hover,
#remove-cover-button:hover {
    background: rgba(108, 117, 125, 0.8) !important;
    background-image: none !important;
    border-color: rgba(108, 117, 125, 1) !important;
}

#cover-status {
    color: rgba(200, 200, 200, 0.7);
    font-size: 0.85em;
}

#current-cover-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: rgba(30, 30, 30, 0.5);
    border-radius: 6px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: wrap;
}

#current-cover-img {
    max-height: 80px;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    flex-shrink: 0;
}

#upload-section {
    margin-top: 15px;
    padding: 10px;
    background: rgba(30, 30, 30, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

#upload-section span {
    color: rgba(200, 200, 200, 0.7);
    font-size: 0.9em;
    white-space: nowrap;
}

#upload-section input[type="file"] {
    max-width: 200px;
    flex-shrink: 0;
}

/* Upload file button for content images - override EVERYTHING */
body.dark-theme #upload-file-button,
body #upload-file-button,
#upload-file-button {
    padding: 8px 16px !important;
    padding: 0.5em 1em !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    color: #e0e0e0 !important;
    background: rgba(0, 123, 255, 0.6) !important;
    background-image: none !important;
    border: 1px solid rgba(0, 123, 255, 0.8) !important;
    transition: all 0.2s ease !important;
    font-size: 0.9em !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    height: auto !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    transform: none !important;
    margin: 0 !important;
}

body.dark-theme #upload-file-button:hover,
body #upload-file-button:hover,
#upload-file-button:hover {
    background: rgba(0, 123, 255, 0.8) !important;
    background-image: none !important;
    border-color: rgba(0, 123, 255, 1) !important;
}

/* =============================================
   ALL BUTTONS - UNIFIED STYLE
   Override ALL other styles including consolidated-dark.css
   ============================================= */

/* Editor actions container */
.editor-actions {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
}

/* ALL buttons in editor-actions - base styles - override EVERYTHING */
body .editor-actions button,
body.dark-theme .editor-actions button {
    padding: 8px 16px !important;
    padding: 0.5em 1em !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    color: #e0e0e0 !important;
    background: rgba(50, 50, 50, 0.85) !important;
    background-image: none !important;
    border: 1px solid rgba(85, 85, 85, 0.6) !important;
    transition: all 0.2s ease !important;
    font-size: 0.9em !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    height: auto !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    transform: none !important;
    margin: 0 !important;
    text-shadow: none !important;
    width: auto !important;
    max-width: none !important;
}

/* Hover state for all editor buttons */
body .editor-actions button:hover,
body.dark-theme .editor-actions button:hover {
    background: rgba(0, 123, 255, 0.3) !important;
    background-image: none !important;
    border-color: rgba(0, 123, 255, 0.5) !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Save button - blue */
body .editor-actions [id^="save-page-button"],
body.dark-theme .editor-actions [id^="save-page-button"],
.editor-actions [id^="save-page-button"] {
    background: rgba(0, 123, 255, 0.6) !important;
    background-image: none !important;
    border-color: rgba(0, 123, 255, 0.8) !important;
}

body .editor-actions [id^="save-page-button"]:hover,
body.dark-theme .editor-actions [id^="save-page-button"]:hover,
.editor-actions [id^="save-page-button"]:hover {
    background: rgba(0, 123, 255, 0.8) !important;
    background-image: none !important;
    border-color: rgba(0, 123, 255, 1) !important;
}

/* Submit pending button - yellow */
body .editor-actions [id^="submit-pending-button"],
body.dark-theme .editor-actions [id^="submit-pending-button"],
.editor-actions [id^="submit-pending-button"] {
    background: rgba(255, 193, 7, 0.6) !important;
    background-image: none !important;
    border-color: rgba(255, 193, 7, 0.8) !important;
}

body .editor-actions [id^="submit-pending-button"]:hover,
body.dark-theme .editor-actions [id^="submit-pending-button"]:hover,
.editor-actions [id^="submit-pending-button"]:hover {
    background: rgba(255, 193, 7, 0.8) !important;
    background-image: none !important;
    border-color: rgba(255, 193, 7, 1) !important;
}

/* Publish button - green */
body .editor-actions [id^="publish-page-button"],
body.dark-theme .editor-actions [id^="publish-page-button"],
.editor-actions [id^="publish-page-button"] {
    background: rgba(40, 167, 69, 0.6) !important;
    background-image: none !important;
    border-color: rgba(40, 167, 69, 0.8) !important;
}

body .editor-actions [id^="publish-page-button"]:hover,
body.dark-theme .editor-actions [id^="publish-page-button"]:hover,
.editor-actions [id^="publish-page-button"]:hover {
    background: rgba(40, 167, 69, 0.8) !important;
    background-image: none !important;
    border-color: rgba(40, 167, 69, 1) !important;
}

/* Cancel button - gray */
body .editor-actions [id^="cancel-edit-button"],
body.dark-theme .editor-actions [id^="cancel-edit-button"],
.editor-actions [id^="cancel-edit-button"] {
    background: rgba(108, 117, 125, 0.6) !important;
    background-image: none !important;
    border-color: rgba(108, 117, 125, 0.8) !important;
}

body .editor-actions [id^="cancel-edit-button"]:hover,
body.dark-theme .editor-actions [id^="cancel-edit-button"]:hover,
.editor-actions [id^="cancel-edit-button"]:hover {
    background: rgba(108, 117, 125, 0.8) !important;
    background-image: none !important;
    border-color: rgba(108, 117, 125, 1) !important;
}

/* Page actions container */
#page-actions {
    display: flex;
    gap: 10px;
    margin: 15px 0;
    flex-wrap: wrap;
}

/* Hide buttons by default - JS will show based on permissions */
#page-actions button {
    display: none !important;
}

/* ALL buttons in page-actions - base styles - override EVERYTHING */
body #page-actions button.show,
body.dark-theme #page-actions button.show {
    padding: 8px 16px !important;
    padding: 0.5em 1em !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    color: #e0e0e0 !important;
    background: rgba(50, 50, 50, 0.85) !important;
    background-image: none !important;
    border: 1px solid rgba(85, 85, 85, 0.6) !important;
    transition: all 0.2s ease !important;
    font-size: 0.9em !important;
    font-weight: 500 !important;
    font-family: inherit !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 38px !important;
    height: auto !important;
    line-height: 1.4 !important;
    box-shadow: none !important;
    transform: none !important;
    margin: 0 !important;
    text-shadow: none !important;
    width: auto !important;
    max-width: none !important;
}

/* Hover state for all page-actions buttons */
body #page-actions button:hover,
body.dark-theme #page-actions button:hover {
    background: rgba(0, 123, 255, 0.3) !important;
    background-image: none !important;
    border-color: rgba(0, 123, 255, 0.5) !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Edit button - blue */
body #page-actions #edit-page-button.show,
body.dark-theme #page-actions #edit-page-button.show,
#page-actions #edit-page-button.show {
    background: rgba(108, 117, 125, 0.6) !important;
    background-image: none !important;
    border-color: rgba(108, 117, 125, 0.8) !important;
}

body #page-actions #edit-page-button.show:hover,
body.dark-theme #page-actions #edit-page-button.show:hover,
#page-actions #edit-page-button.show:hover {
    background: rgba(108, 117, 125, 0.8) !important;
    background-image: none !important;
    border-color: rgba(108, 117, 125, 1) !important;
}

/* New article button - green */
body #page-actions #new-page-button.show,
body.dark-theme #page-actions #new-page-button.show,
#page-actions #new-page-button.show {
    background: rgba(40, 167, 69, 0.6) !important;
    background-image: none !important;
    border-color: rgba(40, 167, 69, 0.8) !important;
}

body #page-actions #new-page-button.show:hover,
body.dark-theme #page-actions #new-page-button.show:hover,
#page-actions #new-page-button.show:hover {
    background: rgba(40, 167, 69, 0.8) !important;
    background-image: none !important;
    border-color: rgba(40, 167, 69, 1) !important;
}

/* Delete button - red */
body #page-actions #delete-page-button.show,
body.dark-theme #page-actions #delete-page-button.show,
#page-actions #delete-page-button.show {
    background: rgba(220, 53, 69, 0.7) !important;
    background-image: none !important;
    border-color: rgba(220, 53, 69, 0.9) !important;
}

body #page-actions #delete-page-button.show:hover,
body.dark-theme #page-actions #delete-page-button.show:hover,
#page-actions #delete-page-button.show:hover {
    background: rgba(220, 53, 69, 0.9) !important;
    background-image: none !important;
    border-color: rgba(220, 53, 69, 1) !important;
}

/* Responsive */
@media (max-width: 768px) {
    header {
        padding: 0.6em;
    }

    header h1 {
        font-size: 1.3em;
        width: 100%;
    }

    .header-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding-bottom: 10px;
    }

    .header-nav {
        width: 100%;
        justify-content: flex-start;
    }

    .user-greeting {
        width: 100%;
        margin-bottom: 5px;
    }

    .filter-bar {
        gap: 8px;
        padding: 8px 0;
        width: 100%;
    }

    .category-filters,
    .status-filters {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    .category-filters::-webkit-scrollbar,
    .status-filters::-webkit-scrollbar {
        display: none;
    }

    .category-filters {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 6px;
    }

    .category-btn,
    .new-article-btn {
        flex: 0 0 auto;
        white-space: nowrap;
        padding: 8px 12px;
        font-size: 0.85em;
    }

    .new-article-btn {
        margin-left: 0;
    }

    .status-filters {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        padding-top: 6px;
    }

    .filter-label {
        width: 100%;
        margin-bottom: 4px;
    }

    .status-btn {
        flex: 0 0 auto;
        font-size: 0.75em;
        padding: 5px 8px;
    }

    .status-count {
        display: none;
    }

    #editor-meta {
        flex-direction: column;
        align-items: flex-start;
    }

    #editor-category-wrapper,
    #editor-author-wrapper,
    #editor-researcher-folder-wrapper,
    #editor-dates-wrapper {
        width: 100%;
        margin-bottom: 10px;
    }

    #editor-category,
    #editor-author-name,
    #editor-researcher-folder {
        width: 100%;
        max-width: none;
    }

    .date-inputs {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .date-inputs input[type="datetime-local"] {
        width: 100%;
    }

    .date-inputs span {
        display: none;
    }
}

/* ==================== SSR: Back to list button ==================== */
.back-to-list-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--bg-elevated, #243042);
    color: var(--accent-blue, #3b82f6);
    text-decoration: none;
    border-radius: var(--radius-md, 8px);
    font-weight: 500;
    transition: all 0.2s ease;
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
}

.back-to-list-btn:hover {
    background: var(--accent-blue, #3b82f6);
    color: var(--text-primary, #e8eff6);
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow-blue, 0 0 24px rgba(59, 130, 246, 0.25));
}

/* ==================== SSR: Error block ==================== */
.ssr-error {
    text-align: center;
    padding: 3rem 1rem;
}

.ssr-error h2 {
    color: var(--accent-red, #ef4444);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.ssr-error .back-to-list-btn {
    margin-top: 1rem;
}

/* ==================== SEO Section in Editor ==================== */
#seo-section {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-secondary, #111820);
    border-radius: var(--radius-md, 8px);
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
}

#seo-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary, #e8eff6);
}

#editor-meta-description {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg-tertiary, #1a2330);
    color: var(--text-primary, #e8eff6);
    border: 1px solid var(--border-color, rgba(255,255,255,0.15));
    border-radius: var(--radius-sm, 6px);
    font-size: 0.9rem;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.2s ease;
}

#editor-meta-description:focus {
    outline: none;
    border-color: var(--accent-blue, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

#editor-meta-description::placeholder {
    color: var(--text-muted, #475569);
}

#meta-description-status {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
}

/* ==================== Slug Section ==================== */
#slug-section {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-secondary, #111820);
    border-radius: var(--radius-md, 8px);
    border: 1px solid var(--border-color, rgba(255,255,255,0.1));
}
#slug-section label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-primary, #e8eff6);
}
#editor-slug {
    width: 100%;
    padding: 0.6rem 0.8rem;
    background: var(--bg-tertiary, #1a2330);
    color: var(--text-primary, #e8eff6);
    border: 1px solid var(--border-color, rgba(255,255,255,0.15));
    border-radius: var(--radius-sm, 6px);
    font-size: 0.9rem;
    font-family: monospace;
    transition: border-color 0.2s ease;
}
#editor-slug:focus {
    outline: none;
    border-color: var(--accent-blue, #3b82f6);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}
#editor-slug::placeholder {
    color: var(--text-muted, #475569);
    font-family: inherit;
}
#slug-status {
    display: block;
    margin-top: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #94a3b8);
}




/* news_v20: related game selector, scheduled publishing and related article cards */
#editor-related-game-wrapper,
#editor-publish-at-wrapper,
.game-form {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

#editor-related-game-wrapper,
#editor-publish-at-wrapper {
    padding: 0.85rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.34);
}

#editor-related-game-wrapper label,
#editor-publish-at-wrapper label {
    color: var(--text-primary, #e5e7eb);
    font-weight: 650;
}

#editor-related-game,
#editor-publish-at {
    min-width: min(100%, 280px);
    padding: 0.58rem 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.65);
    color: var(--text-primary, #e5e7eb);
}

.editor-field-note {
    color: var(--text-muted, #94a3b8);
    font-size: 0.86rem;
}

.small-editor-button,
#toggle-game-form-button,
#save-game-button {
    padding: 0.5rem 0.8rem;
    border: 1px solid rgba(59, 130, 246, 0.45);
    border-radius: 10px;
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.small-editor-button:hover,
#toggle-game-form-button:hover,
#save-game-button:hover {
    background: rgba(59, 130, 246, 0.22);
    border-color: rgba(96, 165, 250, 0.75);
    transform: translateY(-1px);
}

.game-form {
    margin-top: 0.65rem;
    padding: 0.9rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.42);
}

.game-form input {
    min-width: min(100%, 300px);
    padding: 0.58rem 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.65);
    color: var(--text-primary, #e5e7eb);
}

#game-form-status {
    color: var(--text-muted, #94a3b8);
    font-size: 0.9rem;
}

.related-game-box,
.related-articles-box {
    margin: 2.2rem 0;
    padding: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.82), rgba(30, 41, 59, 0.52));
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

.related-game-label,
.related-section-kicker {
    color: #93c5fd;
    font-size: 0.78rem;
    margin-bottom: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
}

.related-game-box h3,
.related-articles-box h3 {
    margin: 0 0 0.7rem;
    color: var(--text-primary, #f8fafc);
}

.related-game-box p {
    margin: 0 0 0.75rem;
    color: var(--text-secondary, #cbd5e1);
}

.related-game-link {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.3rem;
    padding-bottom: 0.16rem;
    color: #60a5fa;
    font-weight: 700;
    text-decoration: none;
}

.related-game-link::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #60a5fa, rgba(96, 165, 250, 0.12));
    transform: scaleX(0.45);
    transform-origin: left;
    transition: transform 0.18s ease, background 0.18s ease;
}

.related-game-link:hover {
    color: #bfdbfe;
}

.related-game-link:hover::after {
    transform: scaleX(1);
    background: linear-gradient(90deg, #bfdbfe, #60a5fa);
}

.related-articles-cards {
    display: grid;
    gap: 0.85rem;
}

.related-article-card {
    display: grid;
    grid-template-columns: 148px minmax(0, 1fr);
    gap: 1rem;
    min-height: 92px;
    padding: 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.14);
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.36);
    color: inherit;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.related-article-card:hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.45);
    background: rgba(15, 23, 42, 0.72);
}

.related-article-thumb {
    display: block;
    width: 100%;
    min-height: 86px;
    overflow: hidden;
    border-radius: 11px;
    background: rgba(15, 23, 42, 0.9);
}

.related-article-thumb img {
    width: 100%;
    height: 100%;
    min-height: 86px;
    object-fit: cover;
    display: block;
}

.related-article-thumb-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    min-height: 86px;
    color: #93c5fd;
    font-weight: 800;
    letter-spacing: 0.08em;
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.25), rgba(15, 23, 42, 0.95));
}

.related-article-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.35rem;
    min-width: 0;
}

.related-article-body strong {
    color: var(--text-primary, #f8fafc);
    font-size: 1rem;
    line-height: 1.25;
}

.related-article-body span {
    color: var(--text-secondary, #cbd5e1);
    font-size: 0.92rem;
    line-height: 1.35;
}

.related-article-body small {
    color: var(--text-muted, #94a3b8);
    font-size: 0.82rem;
}

@media (max-width: 700px) {
    #editor-related-game,
    #editor-publish-at,
    .game-form input {
        width: 100%;
        min-width: 0;
    }
    .related-article-card {
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 0.75rem;
    }
    .related-article-thumb,
    .related-article-thumb img,
    .related-article-thumb-placeholder {
        min-height: 78px;
    }
}

@media (max-width: 480px) {
    .related-article-card {
        grid-template-columns: 1fr;
    }
    .related-article-thumb,
    .related-article-thumb img,
    .related-article-thumb-placeholder {
        min-height: 145px;
    }
}


/* v21: publish_at calendar control */
.publish-at-control {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.publish-at-control input[type="datetime-local"] {
    min-width: 240px;
}

#clear-publish-at-button {
    white-space: nowrap;
}

/* news_v22: multi related games, article-specific related text, editor button cleanup */
#editor-related-games-text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.34);
}

#editor-related-games-text-wrapper label {
    color: var(--text-primary, #e5e7eb);
    font-weight: 650;
}

#editor-related-games-text {
    width: 100%;
    min-height: 86px;
    resize: vertical;
    padding: 0.68rem 0.78rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.65);
    color: var(--text-primary, #e5e7eb);
    font: inherit;
    line-height: 1.45;
}

#editor-related-games-text::placeholder,
#game-cover-input::placeholder {
    color: var(--text-muted, #64748b);
}

.related-games-picker {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    min-width: min(100%, 420px);
}

.related-game-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.48rem 0.7rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 999px;
    background: rgba(2, 6, 23, 0.48);
    color: var(--text-secondary, #cbd5e1);
    cursor: pointer;
    user-select: none;
    transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.related-game-checkbox:hover {
    transform: translateY(-1px);
    border-color: rgba(96, 165, 250, 0.52);
    background: rgba(15, 23, 42, 0.75);
    color: var(--text-primary, #f8fafc);
}

.related-game-checkbox input {
    width: 15px;
    height: 15px;
    accent-color: #60a5fa;
}

.related-games-empty {
    color: var(--text-muted, #94a3b8);
    font-size: 0.92rem;
}

.related-games-intro {
    margin: 0 0 1rem;
    max-width: 820px;
    color: var(--text-secondary, #cbd5e1);
    line-height: 1.55;
}

.related-games-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.9rem;
}

.related-game-card {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 0.85rem;
    align-items: center;
    padding: 0.72rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.38);
    color: inherit;
    text-decoration: none;
    transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.related-game-card:hover {
    transform: translateY(-2px);
    border-color: rgba(96, 165, 250, 0.48);
    background: rgba(15, 23, 42, 0.76);
}

.related-game-cover {
    display: block;
    width: 92px;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.9);
}

.related-game-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.related-game-cover-placeholder {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: 112px;
    color: #93c5fd;
    font-weight: 850;
    letter-spacing: 0.08em;
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.28), rgba(15, 23, 42, 0.96));
}

.related-game-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.45rem;
    min-width: 0;
}

.related-game-info strong {
    color: var(--text-primary, #f8fafc);
    font-size: 1.02rem;
    line-height: 1.25;
}

#save-page-button,
#submit-pending-button,
#publish-page-button,
#cancel-edit-button,
#upload-cover-button,
#remove-cover-button,
#upload-file-button,
#generate-meta-description-button,
#save-game-button,
#clear-publish-at-button,
#toggle-game-form-button {
    border-radius: 10px;
    font-weight: 650;
}

#generate-meta-description-button,
#upload-file-button,
#upload-cover-button,
#remove-cover-button,
#save-game-button,
#clear-publish-at-button,
#toggle-game-form-button {
    padding: 0.5rem 0.8rem;
    border: 1px solid rgba(59, 130, 246, 0.45);
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

#generate-meta-description-button:hover,
#upload-file-button:hover,
#upload-cover-button:hover,
#remove-cover-button:hover,
#save-game-button:hover,
#clear-publish-at-button:hover,
#toggle-game-form-button:hover {
    background: rgba(59, 130, 246, 0.24);
    border-color: rgba(96, 165, 250, 0.78);
    transform: translateY(-1px);
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
    opacity: 0.85;
    cursor: pointer;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

@media (max-width: 700px) {
    .related-games-picker,
    #editor-related-games-text,
    #game-cover-input {
        width: 100%;
        min-width: 0;
    }
    .related-game-card {
        grid-template-columns: 78px minmax(0, 1fr);
    }
    .related-game-cover {
        width: 78px;
    }
}

@media (max-width: 480px) {
    .related-games-cards {
        grid-template-columns: 1fr;
    }
}

/* news_v23: searchable multi-game picker, global descriptions per game/combination, editor panels */
.editor-panel-block {
    padding: 0.95rem 1rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.38);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.editor-panel-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.related-games-combobox {
    position: relative;
    width: 100%;
    min-height: 46px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.45rem;
    padding: 0.45rem 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.68);
    cursor: text;
}

.related-games-combobox:focus-within {
    border-color: rgba(96, 165, 250, 0.75);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.related-games-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.related-game-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.45rem 0.35rem 0.65rem;
    border: 1px solid rgba(96, 165, 250, 0.4);
    border-radius: 999px;
    background: rgba(30, 64, 175, 0.22);
    color: #dbeafe;
    font-size: 0.9rem;
    line-height: 1;
}

.related-game-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 0;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.55);
    color: #bfdbfe;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
}

.related-game-tag-remove:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #fecaca;
}

#related-games-search {
    flex: 1 1 220px;
    min-width: 190px;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-primary, #e5e7eb);
    font: inherit;
    padding: 0.25rem 0.2rem;
}

#related-games-search::placeholder {
    color: var(--text-muted, #64748b);
}

.related-games-dropdown {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 50;
    max-height: 260px;
    overflow-y: auto;
    border: 1px solid rgba(148, 163, 184, 0.25);
    border-radius: 12px;
    background: #0f172a;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
    padding: 0.35rem;
}

.related-games-dropdown-item,
.related-games-dropdown-empty {
    width: 100%;
    display: block;
    padding: 0.65rem 0.75rem;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text-secondary, #cbd5e1);
    text-align: left;
    font: inherit;
}

.related-games-dropdown-item {
    cursor: pointer;
}

.related-games-dropdown-item:hover {
    background: rgba(59, 130, 246, 0.15);
    color: var(--text-primary, #f8fafc);
}

.related-games-dropdown-empty {
    color: var(--text-muted, #94a3b8);
}

.editor-cover-block {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.cover-upload-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex-wrap: wrap;
}

#editor-cover-image,
#file-upload-input {
    color: var(--text-secondary, #cbd5e1);
}

#editor-cover-image::file-selector-button,
#file-upload-input::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.48rem 0.75rem;
    border: 1px solid rgba(59, 130, 246, 0.45);
    border-radius: 9px;
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
    cursor: pointer;
}

#editor-cover-image::file-selector-button:hover,
#file-upload-input::file-selector-button:hover {
    background: rgba(59, 130, 246, 0.24);
}

@media (max-width: 640px) {
    .related-games-combobox,
    .cover-upload-row {
        align-items: stretch;
    }
    #related-games-search {
        flex-basis: 100%;
        min-width: 0;
    }
}

/* news_v24: game covers, cleaner game editor, article cover moved above scheduling */
#game-form.game-form {
    flex-direction: column;
    gap: 0.85rem;
}

.game-form-header,
.game-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.game-form-header strong {
    color: var(--text-primary, #f8fafc);
    font-size: 1rem;
}

.game-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 0.75rem;
}

.game-form-grid label,
.game-cover-controls {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    color: var(--text-secondary, #cbd5e1);
    font-size: 0.92rem;
}

.game-form-grid input {
    width: 100%;
    padding: 0.68rem 0.78rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.65);
    color: var(--text-primary, #e5e7eb);
    font: inherit;
}

.game-cover-manager {
    display: grid;
    grid-template-columns: 132px minmax(0, 1fr);
    gap: 0.9rem;
    align-items: center;
    padding: 0.85rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 13px;
    background: rgba(2, 6, 23, 0.35);
}

.game-cover-preview {
    width: 132px;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    border-radius: 13px;
    border: 1px solid rgba(96, 165, 250, 0.22);
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.22), rgba(15, 23, 42, 0.96));
    display: grid;
    place-items: center;
    color: #93c5fd;
    font-weight: 750;
    text-align: center;
    padding: 0.6rem;
}

.game-cover-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

#game-cover-file-input {
    color: var(--text-secondary, #cbd5e1);
}

#game-cover-file-input::file-selector-button {
    margin-right: 0.75rem;
    padding: 0.48rem 0.75rem;
    border: 1px solid rgba(59, 130, 246, 0.45);
    border-radius: 9px;
    background: rgba(59, 130, 246, 0.14);
    color: #bfdbfe;
    cursor: pointer;
}

#game-cover-file-input::file-selector-button:hover {
    background: rgba(59, 130, 246, 0.24);
}

.games-admin-list {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-height: 260px;
    overflow: auto;
    padding-top: 0.35rem;
}

.games-admin-item {
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr) auto;
    gap: 0.65rem;
    align-items: center;
    padding: 0.55rem;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.35);
}

.games-admin-thumb {
    width: 48px;
    aspect-ratio: 4 / 5;
    border-radius: 9px;
    overflow: hidden;
    display: grid;
    place-items: center;
    color: #93c5fd;
    font-size: 0.78rem;
    font-weight: 800;
    background: rgba(15, 23, 42, 0.9);
}

.games-admin-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.games-admin-meta {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
}

.games-admin-meta strong {
    color: var(--text-primary, #f8fafc);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.games-admin-meta small {
    color: var(--text-muted, #94a3b8);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.games-admin-empty {
    color: var(--text-muted, #94a3b8);
    font-size: 0.92rem;
}

#reset-game-form-button,
.games-admin-edit {
    padding: 0.45rem 0.7rem;
    border: 1px solid rgba(148, 163, 184, 0.28);
    background: rgba(15, 23, 42, 0.55);
    color: #cbd5e1;
}

#reset-game-form-button:hover,
.games-admin-edit:hover {
    border-color: rgba(96, 165, 250, 0.65);
    background: rgba(30, 64, 175, 0.24);
    color: #dbeafe;
}

@media (max-width: 640px) {
    .game-cover-manager,
    .games-admin-item {
        grid-template-columns: 1fr;
    }
    .game-cover-preview {
        width: min(180px, 100%);
    }
}

/* news_v25: keep article cover/editor blocks on separate rows without touching editor logic */
#editor-extra-fields.editor-extra-fields {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    margin: 0.85rem 0 1.1rem;
}

#editor-extra-fields .editor-panel-block,
#editor-extra-fields #editor-publish-at-wrapper,
#editor-extra-fields #current-cover-preview,
#editor-extra-fields #game-form {
    width: 100%;
    box-sizing: border-box;
}

#editor-cover-wrapper.editor-cover-block {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0.65rem !important;
    flex: none !important;
}

#editor-cover-wrapper .cover-upload-row {
    width: 100%;
}

#current-cover-preview {
    margin-top: -0.35rem;
}

/* news_v28: custom scheduled publications calendar */
.scheduled-publications-calendar {
    margin-top: 0.85rem;
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.72));
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.04);
}

.scheduled-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.scheduled-calendar-header strong {
    color: var(--text-primary, #f8fafc);
    font-size: 0.98rem;
    letter-spacing: 0.01em;
}

.scheduled-calendar-nav {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.24);
    background: rgba(15, 23, 42, 0.8);
    color: #dbeafe;
    cursor: pointer;
    font-size: 1.4rem;
    line-height: 1;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.scheduled-calendar-nav:hover {
    border-color: rgba(96, 165, 250, 0.65);
    background: rgba(30, 64, 175, 0.34);
    transform: translateY(-1px);
}

.scheduled-calendar-weekdays,
.scheduled-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 0.38rem;
}

.scheduled-calendar-weekdays {
    margin-bottom: 0.42rem;
}

.scheduled-calendar-weekdays span {
    color: var(--text-muted, #94a3b8);
    font-size: 0.76rem;
    text-align: center;
}

.scheduled-calendar-day {
    position: relative;
    min-height: 42px;
    border: 1px solid rgba(148, 163, 184, 0.16);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.58);
    color: var(--text-secondary, #cbd5e1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .16s ease, background .16s ease, color .16s ease, transform .16s ease;
}

.scheduled-calendar-day:not(.is-empty):hover {
    border-color: rgba(96, 165, 250, 0.7);
    background: rgba(30, 64, 175, 0.28);
    color: #fff;
    transform: translateY(-1px);
}

.scheduled-calendar-day.is-empty {
    border-color: transparent;
    background: transparent;
    cursor: default;
}

.scheduled-calendar-day.is-today {
    border-color: rgba(34, 197, 94, 0.45);
}

.scheduled-calendar-day.is-selected {
    border-color: rgba(96, 165, 250, 0.88);
    background: rgba(37, 99, 235, 0.34);
    color: #fff;
}

.scheduled-calendar-day.has-scheduled {
    border-color: rgba(245, 158, 11, 0.62);
    box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.14), 0 0 18px rgba(245, 158, 11, 0.08);
}

.scheduled-calendar-day-number {
    font-weight: 700;
    font-size: 0.92rem;
}

.scheduled-calendar-marker {
    position: absolute;
    right: 5px;
    top: 5px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 999px;
    background: #f59e0b;
    color: #111827;
    font-size: 0.68rem;
    font-weight: 900;
    line-height: 17px;
    text-align: center;
}

.scheduled-calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem 0.9rem;
    align-items: center;
    margin-top: 0.75rem;
    color: var(--text-muted, #94a3b8);
    font-size: 0.82rem;
}

.scheduled-calendar-legend .legend-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #f59e0b;
    margin-right: 0.35rem;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.scheduled-calendar-hint {
    color: #64748b;
}

@media (max-width: 640px) {
    .scheduled-publications-calendar {
        padding: 0.75rem;
    }
    .scheduled-calendar-weekdays,
    .scheduled-calendar-grid {
        gap: 0.26rem;
    }
    .scheduled-calendar-day {
        min-height: 36px;
        border-radius: 10px;
    }
    .scheduled-calendar-marker {
        right: 3px;
        top: 3px;
    }
}


/* news_v29: scheduled calendar API error */
.scheduled-calendar-error {
    padding: 12px 14px;
    border: 1px solid rgba(255, 193, 7, 0.35);
    border-radius: 10px;
    background: rgba(255, 193, 7, 0.08);
    color: #ffd36a;
    font-size: 0.92rem;
}

/* v32: статус отложенной публикации */
.status-scheduled {
    background: rgba(14, 165, 233, 0.18);
    color: #7dd3fc;
    border: 1px solid rgba(125, 211, 252, 0.25);
}

/* v33: editor workspace UX polish for laptops and smaller screens */
#editor-view {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0.75rem 0 2rem;
    max-height: none !important;
    overflow: visible !important;
}

#editor-toolbar,
#table-context-toolbar,
#editor-meta,
#upload-section,
#seo-section,
#slug-section {
    width: 100%;
    border: 1px solid rgba(148, 163, 184, 0.12);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.34);
    box-shadow: none;
}

#editor-toolbar {
    top: 10px !important;
    padding: 8px !important;
    border-radius: 14px !important;
    gap: 8px !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scrollbar-width: thin;
    background: rgba(15, 23, 42, 0.9) !important;
    border-color: rgba(96, 165, 250, 0.16) !important;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.22) !important;
}

#editor-toolbar button {
    flex: 0 0 auto;
    min-width: 42px;
    min-height: 40px;
    padding: 0 12px;
}

#editor-page-title {
    width: 100% !important;
    margin-bottom: 0 !important;
    padding: 14px 16px !important;
    border-radius: 14px !important;
    font-size: clamp(1.45rem, 2vw, 1.95rem) !important;
    background: rgba(15, 23, 42, 0.5) !important;
    border-color: rgba(148, 163, 184, 0.16) !important;
}

#editor-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 0.8rem 0 0;
    padding: 14px 16px;
    align-items: start;
}

#editor-extra-fields {
    border: 0;
    background: transparent;
    box-shadow: none;
    padding: 0;
}

#editor-extra-fields .editor-panel-block,
#editor-extra-fields #editor-publish-at-wrapper,
#editor-extra-fields #current-cover-preview,
#editor-extra-fields #game-form {
    border: 1px solid rgba(148, 163, 184, 0.1);
    background: rgba(15, 23, 42, 0.26);
    box-shadow: none;
}

#editor-category-wrapper,
#editor-author-wrapper,
#editor-researcher-folder-wrapper,
#editor-dates-wrapper {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-width: 0;
}

#editor-category-wrapper label,
#editor-author-wrapper label,
#editor-researcher-folder-wrapper label,
#editor-dates-wrapper label,
#editor-publish-at-wrapper label,
#seo-section label,
#slug-section label {
    color: #dbe7f5;
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

#editor-category,
#editor-author-name,
#editor-researcher-folder,
.date-inputs input[type="datetime-local"],
#editor-publish-at,
#editor-meta-description,
#editor-slug {
    width: 100% !important;
    max-width: none !important;
}

.date-inputs {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 8px;
    align-items: center;
}

#editor-extra-fields {
    margin: 0.25rem 0 0.5rem;
}

#editor {
    width: 100%;
    max-width: none;
    min-height: 62vh;
    padding: 20px 22px;
    border-radius: 16px;
    background: rgba(2, 6, 23, 0.48);
    border-color: rgba(148, 163, 184, 0.12);
}

.editor-actions {
    margin: 0;
    padding: 12px;
    border: 1px solid rgba(148, 163, 184, 0.1);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.26);
    backdrop-filter: none;
}

#page-content ul {
    list-style-type: disc;
    padding-left: 1.5em;
}

#page-content ol {
    list-style-type: decimal;
    padding-left: 1.5em;
}

#upload-section,
#seo-section,
#slug-section {
    margin-top: 0.85rem;
    padding: 14px 16px;
}

#upload-section {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

#upload-section span {
    white-space: normal;
}

#file-upload-input {
    min-width: 0;
}

#editor-meta,
#upload-section,
#seo-section,
#slug-section {
    border-color: rgba(148, 163, 184, 0.1);
    background: rgba(15, 23, 42, 0.26);
}

@media (min-width: 760px) {
    body.editor-mode #editor-view {
        padding-top: 5.5rem;
    }

    body.editor-mode #editor-toolbar {
        position: fixed !important;
        top: 10px !important;
        bottom: auto !important;
        left: 50% !important;
        right: auto !important;
        width: min(1120px, calc(100vw - 24px)) !important;
        transform: translateX(-50%) !important;
        z-index: 130 !important;
        margin-bottom: 0 !important;
        background: rgba(15, 23, 42, 0.94) !important;
        border-color: rgba(96, 165, 250, 0.18) !important;
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28),
                    inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
    }
}

@media (max-width: 980px) {
    #editor-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    #upload-section {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
}

@media (max-width: 700px) {
    #editor-view {
        padding-top: 0.5rem;
    }

    #editor-meta {
        grid-template-columns: 1fr;
    }

    .date-inputs {
        grid-template-columns: 1fr;
    }

    .date-inputs span {
        display: none;
    }

    #editor {
        min-height: 54vh;
        padding: 16px 14px;
    }

    #editor-toolbar {
        position: sticky !important;
        top: 8px !important;
    }
}

/* Articles section */
.category-articles {
    background: rgba(99, 102, 241, 0.16);
    border-color: rgba(129, 140, 248, 0.45);
    color: #c7d2fe;
}

/* Article breadcrumbs */
.article-breadcrumbs {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex-wrap: wrap;
    margin: 0 0 1.1rem;
    font-size: 0.92rem;
    line-height: 1.4;
    color: var(--text-muted, #94a3b8);
}
.article-breadcrumbs a {
    color: var(--accent-color, #69a7ff);
    text-decoration: none;
}
.article-breadcrumbs a:hover {
    text-decoration: underline;
}
.article-breadcrumb-separator {
    opacity: 0.55;
}
.article-breadcrumb-current {
    color: var(--text-muted, #94a3b8);
    max-width: min(62ch, 100%);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .article-breadcrumb-current {
        max-width: 100%;
        white-space: normal;
    }
}
