/* ============================================================
   THE FRINGE — ANOMALY DOSSIERS
   Refined brutalist editorial system
   ============================================================ */

/* Self-hosted Space Mono — no Google dependency (fast for CN users) */
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/space-mono-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Space Mono'; font-style: normal; font-weight: 700; font-display: swap; src: url('fonts/space-mono-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Space Mono'; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/space-mono-400-italic.woff2') format('woff2'); }

:root {
    /* Color */
    --bg: #0a0a09;
    --bg-elev: #131210;
    --bg-modal: #0e0d0b;
    --ink: #e8e3d8;
    --ink-2: #b8b3a4;
    --ink-3: #7a766b;
    --red: #c0392b;
    --red-bright: #e74c3c;
    --red-faint: rgba(192, 57, 43, 0.12);
    --line: #2a2926;
    --line-2: #44413c;

    /* Type */
    --serif: 'Noto Serif SC', 'Songti SC', 'Source Han Serif SC', 'Noto Serif CJK SC', 'STSong', 'SimSun', serif;
    --mono: 'Space Mono', 'DejaVu Sans Mono', 'Courier New', monospace;
    --fs-display: clamp(2.6rem, 6.5vw, 5.5rem);
    --fs-h2: clamp(1.4rem, 2.4vw, 2.2rem);
    --fs-body: clamp(0.95rem, 1.05vw, 1.05rem);
    --fs-small: clamp(0.7rem, 0.8vw, 0.8rem);

    /* Space */
    --s-1: clamp(0.4rem, 0.8vw, 0.6rem);
    --s-2: clamp(0.8rem, 1.4vw, 1.2rem);
    --s-3: clamp(1.2rem, 2.2vw, 2rem);
    --s-4: clamp(2rem, 3.6vw, 3rem);
    --s-5: clamp(3rem, 5.4vw, 5rem);

    /* Chrome */
    --topbar: 44px;
    --max-w: 1680px;
    --ease: cubic-bezier(0.19, 1, 0.22, 1);
}

/* Reset */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    overflow-x: clip;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--serif);
    font-size: var(--fs-body);
    line-height: 1.75;
    min-height: 100vh;
    overflow-x: clip;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

button { font: inherit; color: inherit; background: none; border: none; }
input, textarea, select { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }

::selection { background: var(--red); color: #fff; }

/* Hide native cursor only on fine-pointer devices */
@media (hover: hover) and (pointer: fine) {
    body, body * { cursor: none !important; }
}

/* ============================================================
   Atmosphere: noise, scanlines, spotlight, cursor, progress
   ============================================================ */

.noise-bg {
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 10;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.scanlines {
    position: fixed; inset: 0;
    pointer-events: none;
    z-index: 11;
    background: repeating-linear-gradient(
        to bottom,
        transparent 0,
        transparent 2px,
        rgba(0,0,0,0.18) 3px,
        transparent 4px
    );
    mix-blend-mode: multiply;
    opacity: 0.45;
}

.spotlight {
    position: fixed;
    top: 0; left: 0;
    width: 800px; height: 800px;
    pointer-events: none;
    z-index: 4;
    background: radial-gradient(circle at center, rgba(192,57,43,0.08), transparent 55%);
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.4s;
    will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
    .spotlight { opacity: 1; }
}

.custom-cursor {
    position: fixed;
    top: 0; left: 0;
    width: 24px; height: 24px;
    border: 1px solid var(--red);
    border-radius: 50%;
    pointer-events: none;
    z-index: 9999;
    transform: translate(-50%, -50%);
    transition: width 0.25s var(--ease), height 0.25s var(--ease),
                background 0.25s, border-color 0.25s, border-width 0.1s;
    mix-blend-mode: difference;
    display: none;
    will-change: transform;
}

@media (hover: hover) and (pointer: fine) {
    .custom-cursor { display: block; }
}

.custom-cursor.hovering {
    width: 54px; height: 54px;
    background: rgba(192, 57, 43, 0.2);
    border-color: var(--red-bright);
}

.custom-cursor.clicking {
    width: 16px; height: 16px;
    border-width: 2px;
}

.scroll-progress {
    position: fixed;
    top: var(--topbar);
    left: 0;
    height: 2px;
    width: 0%;
    background: var(--red);
    box-shadow: 0 0 12px var(--red);
    z-index: 60;
    transition: width 0.12s linear;
}

/* ============================================================
   Top status bar
   ============================================================ */

.top-status-bar {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: var(--topbar);
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 clamp(0.8rem, 2vw, 2rem);
    font-family: var(--mono);
    font-size: var(--fs-small);
    color: var(--ink-3);
    z-index: 50;
    background: rgba(10, 10, 9, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    gap: 1rem;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    min-width: 0;
}

#ui-node-status {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pulse {
    position: relative;
    width: 8px; height: 8px;
    background: var(--red);
    border-radius: 50%;
    flex: 0 0 auto;
}

.pulse::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 1px solid var(--red);
    animation: ripple 2.2s infinite var(--ease);
}

.status-right {
    display: flex;
    gap: clamp(0.5rem, 1.5vw, 1.5rem);
    align-items: center;
    flex: 0 1 auto;
    min-width: 0;
}

#lang-selector {
    background: transparent;
    border: none;
    color: var(--ink-3);
    font-family: var(--mono);
    font-size: var(--fs-small);
    padding: 0.2rem 0.4rem 0.2rem 0;
    appearance: none;
    -webkit-appearance: none;
    transition: color 0.2s;
}

#lang-selector option { background: var(--bg); color: var(--ink); }
#lang-selector:hover, #lang-selector:focus { color: var(--ink); outline: none; }

/* ATLAS top entry */
.top-atlas-btn {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--mono); font-size: 0.72rem; letter-spacing: 1.5px;
    color: var(--red); border: 1px solid var(--red);
    padding: 4px 11px; transition: background .25s, color .25s, box-shadow .25s;
    white-space: nowrap; flex: 0 0 auto;
}
.top-atlas-btn .atlas-ico { font-size: 0.9rem; line-height: 1; }
.top-atlas-btn:hover, .top-atlas-btn:focus-visible {
    background: var(--red); color: #fff; box-shadow: 0 0 14px rgba(192,57,43,0.55); outline: none;
}

/* Language segmented switch */
.lang-switch { display: inline-flex; border: 1px solid var(--line-2); flex: 0 0 auto; }
.lang-opt {
    font-family: var(--mono); font-size: 0.7rem; letter-spacing: 1px;
    color: var(--ink-3); padding: 4px 9px; transition: background .2s, color .2s;
    -webkit-tap-highlight-color: transparent;
}
.lang-opt + .lang-opt { border-left: 1px solid var(--line-2); }
.lang-opt.active { background: var(--ink); color: var(--bg); }
.lang-opt:hover:not(.active) { color: var(--ink); }

/* Identity badge */
.identity-badge {
    display: inline-flex; align-items: center; gap: 7px;
    font-family: var(--mono); font-size: 0.72rem; letter-spacing: 1px;
    color: var(--ink-2); border: 1px solid var(--line-2);
    padding: 4px 10px; transition: color .2s, border-color .2s;
    min-width: 0; flex: 0 1 auto;
}
.identity-badge:hover, .identity-badge:focus-visible { color: var(--ink); border-color: var(--ink); outline: none; }
/* Signed-out: a clear call to action, not a fake guest identity */
.identity-badge.logged-out { color: var(--red); border-color: var(--red); background: var(--red-faint); font-weight: 700; }
.identity-badge.logged-out:hover, .identity-badge.logged-out:focus-visible { color: #fff; background: var(--red); border-color: var(--red); }
.identity-badge.logged-out .identity-dot { background: var(--red); box-shadow: 0 0 6px var(--red); animation: idPulse 1.8s ease-in-out infinite; }
.identity-badge.logged-out .identity-name { max-width: none; }
@keyframes idPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }
.identity-dot { width: 6px; height: 6px; border-radius: 50%; background: #4ec9b0; box-shadow: 0 0 6px #4ec9b0; flex: 0 0 auto; }
.identity-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 18ch; }

/* ============================================================
   Layout
   ============================================================ */

.layout-wrapper {
    display: grid;
    grid-template-columns: minmax(320px, 38%) 1fr;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: var(--topbar);
    max-width: var(--max-w);
    margin: 0 auto;
}

/* ============================================================
   Sidebar (left)
   ============================================================ */

.editorial-sidebar {
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: var(--s-5) var(--s-4);
    position: sticky;
    top: var(--topbar);
    height: calc(100vh - var(--topbar));
    gap: var(--s-4);
    overflow-y: auto;
    scrollbar-width: none;
}
.editorial-sidebar::-webkit-scrollbar { display: none; }

.sidebar-top { flex: 0 0 auto; }

.meta-text {
    font-family: var(--mono);
    font-size: var(--fs-small);
    color: var(--ink-3);
    letter-spacing: 2px;
    margin-bottom: var(--s-3);
}

.massive-title {
    font-size: var(--fs-display);
    font-weight: 900;
    line-height: 0.88;
    text-transform: uppercase;
    margin-bottom: var(--s-3);
    letter-spacing: -0.02em;
    color: var(--ink);
    min-height: 1em;
}

.divider-line {
    height: 1px;
    width: 60px;
    background: var(--red);
    margin-bottom: var(--s-3);
    position: relative;
    overflow: hidden;
}

.divider-line::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 60%; height: 100%;
    background: linear-gradient(90deg, transparent, var(--red-bright), transparent);
    animation: scan 3.5s infinite var(--ease);
}

.manifesto {
    font-size: 1rem;
    color: var(--ink-2);
    max-width: 95%;
    margin-bottom: var(--s-3);
    line-height: 1.7;
}

.red-ink { color: var(--red); font-style: italic; }
.accent-text { color: var(--ink); font-weight: 700; }

.publish-btn {
    border-color: var(--red);
    color: var(--red);
}

/* ============================================================
   Nav
   ============================================================ */

.brutalist-nav {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex: 0 0 auto;
}

.nav-item {
    text-align: left;
    color: var(--ink-3);
    font-family: var(--mono);
    font-size: 0.88rem;
    padding: 0.9rem 0;
    border-bottom: 1px solid transparent;
    transition: color 0.3s, padding 0.4s var(--ease), opacity 0.3s, border-color 0.3s;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    opacity: 0.5;
    position: relative;
    letter-spacing: 1px;
    width: 100%;
}

.nav-item::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0;
    width: 0; height: 1px;
    background: var(--red);
    transition: width 0.5s var(--ease);
}

.nav-item .index {
    font-size: 0.7rem;
    color: var(--red);
    transition: transform 0.4s var(--ease);
}

.nav-item:hover,
.nav-item:focus-visible,
.nav-item.active {
    opacity: 1;
    color: var(--ink);
    padding-left: 1rem;
    outline: none;
}

.nav-item:hover .index,
.nav-item.active .index {
    transform: translateX(-4px);
}

.nav-item:hover::after,
.nav-item.active::after {
    width: 100%;
}

/* ============================================================
   Buttons & Inputs
   ============================================================ */

.brutal-btn {
    background: transparent;
    border: 1px solid var(--line-2);
    color: var(--ink);
    font-family: var(--mono);
    padding: 0.85rem 1.5rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    position: relative;
    overflow: hidden;
    transition: color 0.3s, border-color 0.3s;
    z-index: 1;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}

.brutal-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--red);
    transform: translateX(-101%);
    transition: transform 0.45s var(--ease);
    z-index: -1;
}

.brutal-btn:hover,
.brutal-btn:focus-visible {
    color: #fff;
    border-color: var(--red);
    outline: none;
}

.brutal-btn:hover::before,
.brutal-btn:focus-visible::before {
    transform: translateX(0);
}

.brutal-btn:disabled,
.brutal-btn[data-loading="true"] {
    opacity: 0.5;
    pointer-events: none;
}

.brutal-btn[data-loading="true"] {
    color: var(--red);
}

.w-full { width: 100%; margin-top: 1rem; }

.brutal-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--line-2);
    color: var(--ink);
    font-family: var(--mono);
    padding: 0.7rem 0;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.brutal-input:focus { border-bottom-color: var(--red); }
.brutal-input::placeholder { color: var(--ink-3); }

.brutal-input.textarea {
    resize: vertical;
    min-height: 140px;
    border: 1px solid var(--line-2);
    padding: 1rem;
    line-height: 1.6;
}

select.brutal-input {
    appearance: none;
    -webkit-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
        linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
    background-position: calc(100% - 12px) 50%, calc(100% - 7px) 50%;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    padding-right: 24px;
    cursor: pointer;
}

select.brutal-input option { background: var(--bg-modal); color: var(--ink); }

/* ============================================================
   Modals
   ============================================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 100;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s var(--ease);
    padding: 1rem;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-modal);
    border: 1px solid var(--line-2);
    padding: clamp(1.5rem, 3vw, 2.8rem);
    width: 100%;
    max-width: 520px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    position: relative;
    box-shadow: 16px 16px 0 var(--red-faint), 0 30px 60px rgba(0,0,0,0.6);
    transform: translateY(16px) scale(0.96);
    opacity: 0;
    transition: opacity 0.35s var(--ease), transform 0.45s var(--ease);
    scrollbar-width: thin;
    scrollbar-color: var(--line-2) transparent;
}

.modal-overlay.active .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.modal-title {
    font-family: var(--mono);
    font-size: clamp(1.05rem, 1.5vw, 1.4rem);
    color: var(--red);
    margin-bottom: var(--s-3);
    text-transform: uppercase;
    border-bottom: 1px solid var(--line);
    padding-bottom: 1rem;
    letter-spacing: 2px;
}

.close-btn {
    position: absolute;
    top: 0.6rem; right: 0.8rem;
    color: var(--ink-3);
    font-size: 1.6rem;
    line-height: 1;
    width: 36px; height: 36px;
    display: grid;
    place-items: center;
    transition: color 0.2s, transform 0.4s var(--ease);
    border-radius: 0;
}

.close-btn:hover { color: var(--red); transform: rotate(90deg); }

.profile-stats {
    margin-bottom: var(--s-3);
    font-family: var(--mono);
    font-size: 0.85rem;
    color: var(--ink-2);
}
.profile-stats p { margin-bottom: 0.4rem; }

/* auth + account */
.auth-tabs { display: flex; margin-bottom: 1rem; border: 1px solid var(--line-2); }
.auth-tab { flex: 1; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 1px; color: var(--ink-3); padding: 0.5rem; transition: background .2s, color .2s; }
.auth-tab.active { background: var(--ink); color: var(--bg); }
.auth-tab:hover:not(.active) { color: var(--ink); }
#auth-error { font-family: var(--mono); font-size: 0.68rem; color: var(--red); margin-top: 0.6rem; min-height: 1em; letter-spacing: 1px; }
.auth-anon { font-family: var(--mono); font-size: 0.66rem; color: var(--ink-3); margin-top: 1rem; line-height: 1.5; }
.account-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.2rem; }
.account-avatar { font-size: 1.8rem; width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid var(--line-2); color: var(--red); flex: 0 0 auto; }
.account-name { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: var(--ink); }
.account-clr { font-family: var(--mono); font-size: 0.62rem; color: var(--ink-3); letter-spacing: 1px; margin-top: 2px; }
.account-social { display: flex; gap: 1.4rem; font-family: var(--mono); font-size: 0.64rem; color: var(--ink-3); letter-spacing: 1px; margin-bottom: 1.2rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.account-social b { color: var(--red); font-size: 0.95rem; }
.account-actions { display: flex; gap: 0.8rem; margin-top: 0.5rem; }
.account-actions .brutal-btn { flex: 1; }

/* like button + author links + user profile */
.like-btn { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 1px; color: var(--ink-3); border: 1px solid var(--line-2); padding: 1px 7px; margin-left: 8px; transition: color .2s, border-color .2s; white-space: nowrap; }
.like-btn:hover, .like-btn.liked { color: var(--red); border-color: var(--red); }
.author-link { color: var(--red); cursor: pointer; text-decoration: none; border-bottom: 1px dotted transparent; transition: border-color .2s; }
.author-link:hover { border-bottom-color: var(--red); }
.user-box { max-width: 480px; }
.um-bio { font-family: var(--serif); color: var(--ink-2); font-size: 0.92rem; line-height: 1.6; margin-bottom: 1.2rem; min-height: 1em; }
#um-follow { margin-bottom: 1.4rem; }
#um-follow.following { color: var(--red); border-color: var(--red); }
.um-recent-head { font-family: var(--mono); font-size: 0.6rem; color: var(--ink-3); letter-spacing: 2px; margin-bottom: 0.6rem; }
.um-recent { max-height: 40vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.um-row { display: flex; gap: 0.7rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line); font-family: var(--mono); }
.um-row-cat { color: var(--red); flex: 0 0 auto; width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.56rem; letter-spacing: 1px; }
.um-row-title { flex: 1; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-family: var(--serif); font-size: 0.82rem; }

/* ============================================================
   Content
   ============================================================ */

.content-scroll {
    padding: var(--s-5) clamp(2rem, 8vw, 7rem) var(--s-5) clamp(2rem, 5vw, 5rem);
    min-width: 0;
}

.article-block {
    margin-bottom: clamp(4rem, 10vh, 10rem);
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
    max-width: 720px;
}

.article-block.visible {
    opacity: 1;
    transform: translateY(0);
}

.article-header {
    display: flex;
    align-items: stretch;
    gap: clamp(1rem, 2vw, 2rem);
    margin-bottom: 1.5rem;
}

.article-id {
    font-family: var(--mono);
    color: var(--red);
    font-size: 0.78rem;
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    flex: 0 0 auto;
    letter-spacing: 3px;
    border-left: 1px solid var(--red);
    padding-left: 0.3rem;
}

.article-title {
    font-size: var(--fs-h2);
    font-weight: 700;
    line-height: 1.15;
    flex: 1;
    transition: color 0.3s;
    color: var(--ink);
    min-width: 0;
    word-wrap: break-word;
}

.article-title:hover { color: var(--red-bright); }

.article-body {
    font-size: 1.05rem;
    color: var(--ink-2);
    text-align: justify;
    padding-left: clamp(1rem, 2vw, 3rem);
    border-left: 1px solid var(--line);
    margin-bottom: 1.5rem;
    line-height: 1.85;
    overflow-wrap: break-word;
}

.article-body strong { color: var(--ink); }
.article-body .red-ink { font-weight: 600; }

.classified-stamp {
    display: inline-block;
    margin-top: 1rem;
    font-family: var(--mono);
    color: var(--red);
    border: 1px solid var(--red);
    padding: 0.3rem 0.7rem;
    font-size: 0.7rem;
    letter-spacing: 3px;
    transform: rotate(-1.5deg);
}

.article-meta {
    padding-left: clamp(1rem, 2vw, 3rem);
    font-family: var(--mono);
    font-size: 0.72rem;
    color: var(--ink-3);
    display: flex;
    justify-content: space-between;
    border-top: 1px dashed var(--line);
    padding-top: 0.6rem;
    gap: 1rem;
    flex-wrap: wrap;
    letter-spacing: 1px;
}

/* Comments */
.comments-section {
    padding-left: clamp(1rem, 2vw, 3rem);
    margin-top: 1.5rem;
}

.comment-list { margin-bottom: 1rem; }

.comment-item {
    background: rgba(255,255,255,0.015);
    padding: 0.9rem 1rem;
    margin-bottom: 0.5rem;
    border-left: 2px solid var(--line-2);
    font-size: 0.92rem;
    color: var(--ink);
    transition: border-color 0.3s, background 0.3s, transform 0.3s var(--ease);
    line-height: 1.6;
    overflow-wrap: break-word;
}

.comment-item:hover {
    border-left-color: var(--red);
    background: rgba(192,57,43,0.04);
    transform: translateX(4px);
}

.comment-item.fresh {
    animation: commentIn 0.5s var(--ease);
}

.comment-author {
    font-family: var(--mono);
    color: var(--red);
    font-size: 0.7rem;
    margin-bottom: 0.3rem;
    letter-spacing: 1px;
}

.comment-input-area {
    display: flex;
    gap: 0.8rem;
    align-items: stretch;
}

.comment-input-area .brutal-input {
    flex: 1;
    margin: 0;
}

.comment-input-area .brutal-btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.72rem;
    align-self: end;
}

/* Status messages */
.status-message {
    color: var(--red);
    font-family: var(--mono);
    text-align: center;
    margin-top: 15vh;
    letter-spacing: 3px;
    font-size: 0.85rem;
    text-transform: uppercase;
}

.status-message.muted { color: var(--ink-3); }

.caret {
    display: inline-block;
    width: 7px;
    height: 0.9em;
    background: currentColor;
    margin-left: 4px;
    vertical-align: -2px;
    animation: blink 1s steps(1) infinite;
}

/* ============================================================
   Animations
   ============================================================ */

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

@keyframes ripple {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(3.5); opacity: 0; }
}

@keyframes scan {
    0%, 100% { left: -100%; }
    50% { left: 100%; }
}

@keyframes glitch {
    0%, 100% { transform: translate(0); }
    20% { transform: translate(-2px, 1px); }
    40% { transform: translate(2px, -1px); }
    60% { transform: translate(-1px, -1px); }
    80% { transform: translate(1px, 1px); }
}

@keyframes commentIn {
    from { opacity: 0; transform: translateX(-12px); }
    to   { opacity: 1; transform: translateX(0); }
}

.glitching { animation: glitch 0.4s steps(5); }

/* ============================================================
   Responsive
   ============================================================ */

/* Tablet & below: stack layout, horizontal nav strip */
@media (max-width: 1024px) {
    :root { --topbar: 40px; }

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

    .editorial-sidebar {
        position: static;
        height: auto;
        top: 0;
        border-right: none;
        border-bottom: 1px solid var(--line);
        padding: var(--s-4) var(--s-3) 0;
        gap: var(--s-3);
        overflow: visible;
    }

    .content-scroll {
        padding: var(--s-4) var(--s-3);
    }

    .article-block { max-width: none; }

    .manifesto { max-width: 100%; }

    /* Horizontal scrollable nav strip */
    .brutalist-nav {
        flex-direction: row;
        overflow-x: auto;
        gap: 0;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin: var(--s-3) calc(-1 * var(--s-3)) 0;
        padding: 0 var(--s-3);
        border-top: 1px solid var(--line);
    }
    .brutalist-nav::-webkit-scrollbar { display: none; }

    .nav-item {
        flex: 0 0 auto;
        scroll-snap-align: start;
        white-space: nowrap;
        padding: 0.85rem 1.1rem;
        width: auto;
        border-right: 1px solid var(--line);
        gap: 0.7rem;
    }
    .nav-item:last-child { border-right: none; }

    .nav-item::after {
        bottom: 0;
        height: 2px;
    }

    .nav-item:hover,
    .nav-item.active {
        padding-left: 1.1rem;
    }
}

/* Phone */
@media (max-width: 768px) {
    .top-status-bar {
        gap: 0.5rem;
        padding-left: max(0.8rem, env(safe-area-inset-left));
        padding-right: max(0.8rem, env(safe-area-inset-right));
    }
    #ui-node-status { font-size: 0.68rem; max-width: 30vw; }
    .top-atlas-btn { padding: 4px 7px; }
    .top-atlas-lbl { display: none; }
    .lang-opt { padding: 4px 7px; font-size: 0.66rem; }
    .identity-badge { font-size: 0.68rem; padding: 4px 7px; }
    .identity-name { max-width: 11ch; }

    .massive-title { font-size: clamp(2.2rem, 11vw, 3.6rem); }

    .article-header { gap: 0.8rem; }
    .article-id { font-size: 0.7rem; letter-spacing: 2px; }

    .article-body {
        text-align: left;
        padding-left: 0.9rem;
        font-size: 0.98rem;
    }
    .article-meta,
    .comments-section { padding-left: 0.9rem; }

    .comment-input-area { flex-direction: column; gap: 0.5rem; }
    .comment-input-area .brutal-btn {
        align-self: stretch;
        padding: 0.7rem 1rem;
    }

    .scroll-progress { height: 1.5px; }
}

/* Small phone */
@media (max-width: 480px) {
    .editorial-sidebar { padding: var(--s-3) 1rem 0; }
    .content-scroll { padding: var(--s-3) 1rem; }
    .modal-content { padding: 1.5rem 1.2rem; }
    .modal-title { font-size: 1rem; }
    .article-body,
    .article-meta,
    .comments-section { padding-left: 0.6rem; }
    .meta-text { margin-bottom: var(--s-2); }

    /* Slim the status bar so it never overflows on phones */
    .identity-name { max-width: 8ch; }
    #ui-node-status { max-width: 24vw; }
    .top-status-bar { gap: 0.35rem; }
}

/* Ultra-narrow: drop the node label, keep only the pulse dot */
@media (max-width: 360px) {
    #ui-node-status { display: none; }
    .identity-name { max-width: 11ch; }
}

/* Touch devices: tap target sizes */
@media (pointer: coarse) {
    .brutal-btn { min-height: 44px; }
    .close-btn { width: 44px; height: 44px; }
    .nav-item { min-height: 44px; }
}

/* Wide desktop polish */
@media (min-width: 1440px) {
    .editorial-sidebar { padding: var(--s-5) var(--s-5); }
}

/* ============================================================
   RETRO-TECH LAYER — CRT, boot, HUD, signal-lock, audio
   ============================================================ */

/* CRT glass vignette */
.crt-vignette {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 12;
    background: radial-gradient(ellipse at center, transparent 56%, rgba(0,0,0,0.38) 100%);
    box-shadow: inset 0 0 160px rgba(0,0,0,0.55), inset 0 0 40px rgba(0,0,0,0.45);
}

/* Slow rolling refresh band */
.crt-rollbar {
    position: fixed; left: 0; right: 0; top: 0;
    height: 150px; z-index: 11; pointer-events: none;
    background: linear-gradient(to bottom, transparent, rgba(255,255,255,0.022) 46%, rgba(255,255,255,0.05) 50%, rgba(255,255,255,0.022) 54%, transparent);
    mix-blend-mode: screen;
    animation: rollbar 8s linear infinite;
}
@keyframes rollbar { 0% { transform: translateY(-170px); } 100% { transform: translateY(100vh); } }

/* Phosphor glow on accents */
.red-ink, .article-id, .comment-author, .nav-item .index, .classified-stamp {
    text-shadow: 0 0 8px rgba(192,57,43,0.5);
}
.massive-title { text-shadow: 0 0 22px rgba(229,225,216,0.10), 0 0 3px rgba(192,57,43,0.25); }

/* ---- Boot / POST screen ---- */
.boot-screen {
    position: fixed; inset: 0; z-index: 1000;
    background: #050504;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--mono);
}
.boot-screen.done { display: none; }
.boot-screen.crt-off { animation: crtOff 0.5s var(--ease) forwards; transform-origin: center; }
.boot-inner { width: min(720px, 90vw); padding: 1.5rem; }
.boot-log {
    color: var(--ink);
    font-size: clamp(0.62rem, 1.5vw, 0.92rem);
    line-height: 1.7;
    white-space: pre;
    overflow: hidden;
    text-shadow: 0 0 6px rgba(192,57,43,0.4);
    min-height: 13em;
    margin: 0;
}
.boot-log .ok { color: #5fae5f; }
.boot-log .warn { color: var(--red-bright); }
.boot-log .hl { color: var(--red); }
.boot-cursor { display: inline-block; width: 0.55em; height: 1em; background: var(--red); vertical-align: -2px; box-shadow: 0 0 8px var(--red); animation: blink 1s steps(1) infinite; }
.boot-hint { margin-top: 1.8rem; color: var(--ink-3); font-size: 0.68rem; letter-spacing: 2px; animation: blink 1.4s steps(1) infinite; }

@keyframes crtOff {
    0%   { transform: scale(1, 1);        opacity: 1; filter: brightness(1); }
    55%  { transform: scale(1.25, 0.006); opacity: 1; filter: brightness(7); }
    100% { transform: scale(1.7, 0.0008); opacity: 0; filter: brightness(14); }
}

/* Whole-page power-on flicker (no transform → keeps sticky intact) */
.crt-boot-in { animation: crtOn 0.6s var(--ease); }
@keyframes crtOn {
    0%   { opacity: 0; filter: brightness(8) contrast(2); }
    40%  { opacity: 1; filter: brightness(3); }
    62%  { filter: brightness(0.55); }
    100% { opacity: 1; filter: brightness(1); }
}

/* ---- Signal-lock transition (nav switch) ---- */
.signal-lock {
    position: fixed; inset: var(--topbar) 0 0 0;
    z-index: 40; pointer-events: none; opacity: 0;
    background:
        repeating-linear-gradient(0deg, rgba(255,255,255,0.05) 0 1px, transparent 1px 3px),
        rgba(10,10,9,0.5);
}
.signal-lock.active { animation: sigLock 0.42s steps(9); }
@keyframes sigLock { 0% { opacity: 0; } 25% { opacity: 1; } 70% { opacity: 0.7; } 100% { opacity: 0; } }

/* ---- Corner diagnostic HUD ---- */
.hud {
    position: fixed; right: 14px; bottom: 14px; z-index: 45;
    width: 240px;
    border: 1px solid var(--line-2);
    background: rgba(8,8,7,0.74);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    padding: 10px 12px;
    font-family: var(--mono); color: var(--ink-2);
    box-shadow: 0 0 30px rgba(0,0,0,0.6), inset 0 0 0 1px rgba(192,57,43,0.06);
    opacity: 0; transform: translateY(10px);
    transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.hud.show { opacity: 1; transform: none; }
.hud-head { display: flex; align-items: center; gap: 7px; font-size: 0.6rem; letter-spacing: 1px; margin-bottom: 7px; }
.rec-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 0 0 8px var(--red); animation: blink 1.3s steps(1) infinite; }
.rec-label { color: var(--red); }
.hud-timer { margin-left: auto; color: var(--ink); letter-spacing: 1px; }
.hud-scope { display: block; width: 100%; height: 46px; border-bottom: 1px solid var(--line); margin-bottom: 7px; }
.hud-sig { display: flex; align-items: center; gap: 8px; font-size: 0.58rem; letter-spacing: 1px; margin-bottom: 7px; }
.hud-bars { display: flex; gap: 2px; margin-left: auto; }
.hud-bars i { width: 4px; height: 9px; background: var(--line-2); display: block; transition: background 0.2s; }
.hud-bars i.on { background: var(--red); box-shadow: 0 0 5px var(--red); }
.hud-stream { font-size: 0.55rem; line-height: 1.5; color: var(--ink-3); height: 3em; overflow: hidden; white-space: pre; word-break: break-all; margin: 0; }

/* ---- Audio toggle ---- */
.audio-toggle {
    font-family: var(--mono); font-size: 0.72rem; color: var(--ink-3);
    letter-spacing: 1px; padding: 3px 6px; white-space: nowrap;
    border: 1px solid transparent; transition: color 0.2s;
}
.audio-toggle:hover { color: var(--ink); }
.audio-toggle[aria-pressed="true"] { color: var(--red); }
.audio-toggle[aria-pressed="true"] .audio-ico { display: inline-block; animation: pulseAudio 1s ease-in-out infinite; }
@keyframes pulseAudio { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ---- Chromatic glitch enhancement ---- */
.massive-title.glitching,
.article-title.glitching {
    text-shadow: -2px 0 var(--red-bright), 2px 0 #2ce8e8, 0 0 12px rgba(192,57,43,0.3);
}

/* HUD/rollbar are desktop-only flourishes */
@media (max-width: 900px) { .hud { display: none; } }
@media (max-width: 768px) {
    .crt-rollbar { display: none; }
    .audio-toggle { padding: 3px 2px; }
    .audio-toggle .audio-lbl { display: none; }
}

/* ============================================================
   ATLAS — world map + chronology view
   ============================================================ */

.atlas-open-btn { border-color: var(--line-2); color: var(--ink-2); margin-top: 0.8rem; }
.atlas-open-btn:hover, .atlas-open-btn:focus-visible { color: #fff; border-color: var(--ink); }
.atlas-open-btn::before { background: var(--ink); }

.atlas-view {
    position: fixed; inset: 0; z-index: 90;
    background: #070807;
    display: flex; flex-direction: column;
    opacity: 0; pointer-events: none;
    transition: opacity 0.4s var(--ease);
}
.atlas-view.active { opacity: 1; pointer-events: auto; }

.atlas-bar {
    flex: 0 0 auto; display: flex; align-items: center; gap: 1rem;
    padding: 0.7rem clamp(0.8rem, 2vw, 1.6rem);
    border-bottom: 1px solid var(--line-2);
    background: rgba(10,10,9,0.6);
    font-family: var(--mono);
}
.atlas-headings { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.atlas-title { color: var(--ink); font-size: clamp(0.85rem,1.6vw,1.05rem); letter-spacing: 3px; text-shadow: 0 0 10px rgba(192,57,43,0.4); }
.atlas-sub { color: var(--ink-3); font-size: 0.6rem; letter-spacing: 2px; }
.atlas-stat { margin-left: auto; color: var(--red); font-size: 0.66rem; letter-spacing: 1px; white-space: nowrap; }
.atlas-close {
    font-family: var(--mono); font-size: 0.72rem; letter-spacing: 1px;
    color: var(--ink-3); border: 1px solid var(--line-2); padding: 0.4rem 0.7rem;
    transition: color 0.2s, border-color 0.2s; flex: 0 0 auto;
}
.atlas-close:hover { color: var(--red); border-color: var(--red); }

.atlas-stage { flex: 1; display: flex; min-height: 0; }

.atlas-map-wrap {
    flex: 1; position: relative; overflow: hidden; min-width: 0;
    background: radial-gradient(ellipse at center, rgba(192,57,43,0.05), transparent 70%), #070807;
}
.atlas-map { width: 100%; height: 100%; display: block; }

.atlas-land { fill: rgba(192,57,43,0.05); stroke: rgba(184,179,164,0.30); stroke-width: 0.6px; vector-effect: non-scaling-stroke; }
.atlas-grid { stroke: rgba(122,118,107,0.16); stroke-width: 0.5px; vector-effect: non-scaling-stroke; }
.atlas-grid.equator { stroke: rgba(192,57,43,0.22); stroke-dasharray: 4 4; }

.atlas-node { cursor: pointer; }
.atlas-node.zone-hidden { display: none; }
.atlas-node-dot { fill: var(--nc); stroke: #070807; stroke-width: 0.6px; transition: r 0.2s; }
.atlas-node-halo { fill: var(--nc); opacity: 0.16; transform-box: fill-box; transform-origin: center; animation: nodePulse 2.6s ease-out infinite; }
.atlas-node:hover .atlas-node-dot { r: 5.5; }
.atlas-node.active .atlas-node-dot { r: 6; stroke: #fff; stroke-width: 1px; }
.atlas-node.active .atlas-node-halo { opacity: 0.45; }
.atlas-node.dim { opacity: 0.28; }
@keyframes nodePulse { 0% { transform: scale(0.5); opacity: 0.5; } 100% { transform: scale(2.4); opacity: 0; } }

.atlas-scan {
    position: absolute; top: 0; bottom: 0; width: 160px; pointer-events: none;
    background: linear-gradient(90deg, transparent, rgba(192,57,43,0.08), rgba(231,76,60,0.22), rgba(192,57,43,0.08), transparent);
    mix-blend-mode: screen; animation: atlasSweep 7s linear infinite;
}
@keyframes atlasSweep { 0% { left: -160px; } 100% { left: 100%; } }

.atlas-tooltip {
    position: absolute; pointer-events: none; z-index: 5; opacity: 0;
    background: rgba(7,8,7,0.92); border: 1px solid var(--line-2);
    color: var(--ink); font-family: var(--mono); font-size: 0.66rem;
    padding: 4px 8px; max-width: 240px; transition: opacity 0.15s;
    text-shadow: 0 0 6px rgba(192,57,43,0.4);
}

.atlas-dossier {
    width: clamp(280px, 26vw, 360px); flex: 0 0 auto;
    border-left: 1px solid var(--line-2); overflow-y: auto;
    padding: 1.2rem; background: rgba(10,10,9,0.4); scrollbar-width: thin;
}
.atlas-dossier-empty { color: var(--ink-3); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 2px; text-align: center; margin-top: 40%; }
.atlas-card { position: relative; font-family: var(--mono); border-left: 2px solid var(--nc); padding-left: 0.9rem; padding-right: 1.6rem; animation: commentIn 0.4s var(--ease); }
.atlas-card-close { position: absolute; top: 0; right: 0; font-size: 1.3rem; line-height: 1; color: var(--ink-3); width: 28px; height: 28px; display: grid; place-items: center; transition: color .2s, transform .3s; }
.atlas-card-close:hover { color: var(--red); transform: rotate(90deg); }
.atlas-card-cat { color: var(--nc); font-size: 0.62rem; letter-spacing: 2px; }
.atlas-card-id { color: var(--ink-3); font-size: 0.6rem; margin: 0.2rem 0 0.6rem; }
.atlas-card-title { font-family: var(--serif); color: var(--ink); font-size: 1.15rem; line-height: 1.3; margin-bottom: 0.7rem; }
.atlas-card-meta { display: flex; flex-direction: column; gap: 0.2rem; color: var(--ink-2); font-size: 0.66rem; margin-bottom: 0.7rem; }
.atlas-card-stamp { display: inline-block; color: var(--red); border: 1px solid var(--red); padding: 0.2rem 0.5rem; font-size: 0.6rem; letter-spacing: 2px; margin-bottom: 0.7rem; }
.atlas-card-body { font-family: var(--serif); color: var(--ink-2); font-size: 0.9rem; line-height: 1.7; margin-bottom: 1rem; }
.atlas-openfile { width: 100%; font-size: 0.68rem; }

.atlas-timeline-wrap {
    flex: 0 0 auto; border-top: 1px solid var(--line-2);
    background: rgba(10,10,9,0.55); overflow-x: auto; overflow-y: hidden;
    scrollbar-width: none;
}
.atlas-timeline-wrap::-webkit-scrollbar { display: none; }
.atlas-timeline {
    display: flex; align-items: stretch; padding: 0 1rem;
    height: 92px; position: relative; min-width: min-content;
}
.atlas-timeline::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: var(--line); }
.atlas-tl-node {
    flex: 0 0 auto; width: 74px; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 6px; position: relative;
    font-family: var(--mono); color: var(--ink-3); transition: color 0.2s;
}
.atlas-tl-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--nc); box-shadow: 0 0 6px var(--nc); transition: transform 0.2s; z-index: 1; }
.atlas-tl-year { font-size: 0.6rem; letter-spacing: 1px; }
.atlas-tl-node:hover { color: var(--ink); }
.atlas-tl-node:hover .atlas-tl-dot { transform: scale(1.4); }
.atlas-tl-node.active { color: #fff; }
.atlas-tl-node.active .atlas-tl-dot { transform: scale(1.8); box-shadow: 0 0 12px var(--nc); }
.atlas-tl-node.out { opacity: 0.18; }

/* ---- 3D globe + mode switch ---- */
.atlas-map, .atlas-globe { display: none; }
.atlas-view.mode-2d .atlas-map { display: block; }
.atlas-view.mode-3d .atlas-globe { display: block; }
.atlas-view.mode-3d .atlas-scan { display: none; }
.atlas-globe { position: absolute; inset: 0; width: 100%; height: 100%; }
.atlas-globe canvas { display: block; outline: none; }
.atlas-node.out { display: none; }

.atlas-mode-toggle {
    font-family: var(--mono); font-size: 0.7rem; letter-spacing: 1px;
    color: var(--ink-2); border: 1px solid var(--line-2); padding: 0.4rem 0.7rem;
    transition: color .2s, border-color .2s; flex: 0 0 auto; white-space: nowrap;
}
.atlas-mode-toggle:hover { color: var(--red); border-color: var(--red); }

/* ---- time range slider ---- */
.atlas-time-head { display: flex; align-items: center; gap: 0.8rem; padding: 0.5rem 1rem 0.2rem; font-family: var(--mono); font-size: 0.62rem; letter-spacing: 1px; color: var(--ink-3); }
.atlas-time-label { color: var(--ink-2); }
.atlas-time-readout { color: var(--red); text-shadow: 0 0 6px rgba(192,57,43,0.4); }
.atlas-time-reset { margin-left: auto; color: var(--ink-3); border: 1px solid var(--line-2); padding: 2px 8px; font-family: var(--mono); font-size: 0.58rem; letter-spacing: 1px; transition: color .2s, border-color .2s; }
.atlas-time-reset:hover { color: var(--red); border-color: var(--red); }

.atlas-slider { position: relative; height: 32px; margin: 0 1rem; }
.atlas-slider-track { position: absolute; left: 0; right: 0; top: 50%; height: 3px; transform: translateY(-50%); background: var(--line-2); }
.atlas-slider-fill { position: absolute; top: 50%; height: 3px; transform: translateY(-50%); background: var(--red); box-shadow: 0 0 8px var(--red); pointer-events: none; }
.atlas-range { position: absolute; left: 0; top: 0; width: 100%; height: 32px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.atlas-range::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 22px; background: var(--red); border: 1px solid #fff; cursor: ew-resize; pointer-events: auto; box-shadow: 0 0 8px var(--red); }
.atlas-range::-moz-range-thumb { width: 12px; height: 22px; background: var(--red); border: 1px solid #fff; cursor: ew-resize; pointer-events: auto; box-shadow: 0 0 8px var(--red); border-radius: 0; }
.atlas-range::-webkit-slider-runnable-track { background: none; border: none; }
.atlas-range::-moz-range-track { background: none; border: none; }

@media (max-width: 600px) {
    .atlas-headings .atlas-sub { display: none; }
    .atlas-stat { font-size: 0.58rem; }
    .atlas-mode-toggle { padding: 0.35rem 0.5rem; font-size: 0.62rem; }
}

@media (max-width: 860px) {
    .atlas-stage { flex-direction: column; }
    .atlas-map-wrap { flex: 0 0 auto; height: 46vh; }
    .atlas-dossier { width: 100%; flex: 1; border-left: none; border-top: 1px solid var(--line-2); }
    .atlas-dossier-empty { margin-top: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
    .atlas-scan, .atlas-node-halo { animation: none; }
    .atlas-node-halo { opacity: 0.1; }
}

/* ============================================================
   GLOBE HOME — 3D globe as the primary interface
   ============================================================ */

.globe-home {
    position: fixed;
    inset: var(--topbar) 0 0 0;
    z-index: 20;
    display: flex; flex-direction: column;
    background: radial-gradient(ellipse at 50% 45%, rgba(192,57,43,0.07), transparent 70%), #070807;
    overflow: hidden;
}

.globe-bar {
    flex: 0 0 auto; display: flex; align-items: center; gap: 1rem;
    padding: 0.7rem clamp(0.9rem, 2.5vw, 2rem);
    font-family: var(--mono); z-index: 6;
}
.globe-headings { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.globe-title { font-family: var(--serif); font-weight: 900; font-size: clamp(1.1rem, 2vw, 1.6rem); letter-spacing: 3px; color: var(--ink); text-shadow: 0 0 18px rgba(192,57,43,0.35); line-height: 1; }
.globe-sub { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 2px; color: var(--ink-3); }
.globe-stat { margin-left: auto; color: var(--red); font-size: 0.66rem; letter-spacing: 1px; white-space: nowrap; text-shadow: 0 0 6px rgba(192,57,43,0.4); }
.globe-mode-toggle { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 1px; color: var(--ink-3); border: 1px solid var(--line-2); padding: 4px 9px; transition: color .2s, border-color .2s; flex: 0 0 auto; }
.globe-mode-toggle:hover { color: var(--red); border-color: var(--red); }

.globe-stage { position: relative; flex: 1; min-height: 0; }
.globe-stage .atlas-globe { position: absolute; inset: 0; display: block; }
.globe-stage .atlas-map { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.globe-home.mode-2d .atlas-globe { display: none; }
.globe-home.mode-2d .atlas-map { display: block; }
.globe-stage .atlas-scan { display: none; }
.globe-home.mode-2d .atlas-scan { display: block; }

/* four floating zone entries */
.globe-entries { position: absolute; inset: 0; pointer-events: none; z-index: 7; }
.globe-entry {
    position: absolute; pointer-events: auto;
    display: inline-flex; align-items: center; gap: 10px;
    font-family: var(--mono); letter-spacing: 1.5px;
    background: rgba(8,8,7,0.5); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px);
    border: 1px solid var(--c, var(--line-2)); color: var(--ink);
    padding: 10px 15px; transition: background .25s, color .25s, box-shadow .25s, transform .25s var(--ease);
    white-space: nowrap;
}
.globe-entry .ge-idx { color: var(--c, var(--red)); font-size: 0.82rem; }
.globe-entry .ge-lbl { font-size: 0.78rem; }
.globe-entry:hover, .globe-entry:focus-visible {
    background: var(--c, var(--red)); color: #070807; transform: scale(1.05);
    box-shadow: 0 0 24px var(--c, var(--red)); outline: none;
}
.globe-entry:hover .ge-idx, .globe-entry:focus-visible .ge-idx { color: #070807; }
.globe-entry.ge-01 { top: 14%; left: 5%; }
.globe-entry.ge-02 { top: 14%; right: 5%; flex-direction: row-reverse; }
.globe-entry.ge-03 { bottom: 16%; left: 5%; }
.globe-entry.ge-04 { bottom: 16%; right: 5%; flex-direction: row-reverse; }
.globe-entry.ge-05 { top: 10%; left: 50%; transform: translateX(-50%); box-shadow: 0 0 16px rgba(212,175,55,0.25); }
.globe-entry.ge-05:hover, .globe-entry.ge-05:focus-visible { transform: translateX(-50%) scale(1.05); }

/* node dossier card floating on the globe */
.globe-dossier {
    position: absolute; top: 50%; right: clamp(1rem, 3vw, 2.5rem);
    transform: translateY(-50%); width: clamp(250px, 23vw, 330px);
    max-height: 70%; overflow-y: auto; z-index: 8;
    background: rgba(8,8,7,0.78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--line-2); padding: 1.2rem;
    scrollbar-width: thin; pointer-events: auto;
}

/* time slider docked to globe bottom */
.globe-time {
    flex: 0 0 auto; z-index: 6;
    background: linear-gradient(transparent, rgba(7,8,7,0.85) 45%);
    padding: 0.5rem clamp(0.9rem, 2.5vw, 2rem) 0.8rem;
}

/* ---- bottom drawer (zone dossier feed) ---- */
.board-drawer {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 80;
    height: 82vh; height: 82dvh; max-height: 82vh;
    background: var(--bg); border-top: 2px solid var(--red);
    box-shadow: 0 -24px 60px rgba(0,0,0,0.75);
    transform: translateY(101%); transition: transform .5s var(--ease);
    display: flex; flex-direction: column;
}
.board-drawer.open { transform: translateY(0); }
.drawer-head {
    flex: 0 0 auto; display: flex; align-items: center; gap: clamp(0.6rem, 1.5vw, 1.2rem);
    padding: 0.85rem clamp(1rem, 3vw, 2rem);
    border-bottom: 1px solid var(--line); font-family: var(--mono);
}
.drawer-handle { display: inline-flex; align-items: center; gap: 7px; font-family: var(--mono); font-size: 0.68rem; letter-spacing: 1px; color: var(--ink-2); padding: 7px 12px; transition: color .2s, border-color .2s, background .2s; flex: 0 0 auto; border: 1px solid var(--line-2); white-space: nowrap; }
.drawer-handle .dh-arrow { font-size: 0.8rem; color: var(--red); }
.drawer-handle:hover { color: #fff; border-color: var(--red); background: var(--red); }
.drawer-handle:hover .dh-arrow { color: #fff; }
.drawer-idx { color: var(--red); font-size: 0.8rem; letter-spacing: 2px; flex: 0 0 auto; }
.drawer-name { font-family: var(--serif); font-size: clamp(1rem, 2vw, 1.4rem); color: var(--ink); font-weight: 700; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drawer-post { margin-left: auto; flex: 0 0 auto; font-size: 0.66rem; padding: 0.5rem 1rem; }
.drawer-body { flex: 1; overflow-y: auto; padding: clamp(1.5rem, 3vw, 3rem) clamp(1rem, 4vw, 4rem) 6rem; -webkit-overflow-scrolling: touch; }

/* first-visit onboarding */
.onboard { position: fixed; inset: 0; z-index: 85; display: none; align-items: center; justify-content: center; background: rgba(7,8,7,0.82); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); padding: 1rem; }
.onboard.show { display: flex; animation: obFade .4s var(--ease); }
.onboard-card { max-width: 440px; width: 100%; border: 1px solid var(--line-2); background: var(--bg-modal); padding: clamp(1.5rem,3vw,2.5rem); box-shadow: 16px 16px 0 var(--red-faint), 0 30px 60px rgba(0,0,0,0.6); }
.onboard-tag { font-family: var(--mono); font-size: 0.62rem; color: var(--red); letter-spacing: 2px; margin-bottom: 0.6rem; }
.onboard-title { font-family: var(--mono); font-size: clamp(1rem,2vw,1.3rem); color: var(--ink); letter-spacing: 2px; margin-bottom: 1.4rem; text-shadow: 0 0 10px rgba(192,57,43,0.4); }
.onboard-list { list-style: none; margin-bottom: 1.6rem; }
.onboard-list li { display: flex; gap: 0.9rem; align-items: baseline; font-size: 0.95rem; color: var(--ink-2); margin-bottom: 0.95rem; line-height: 1.5; }
.onboard-list .ob-ico { color: var(--red); font-family: var(--mono); flex: 0 0 auto; font-size: 0.9rem; }
@keyframes obFade { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }

@media (max-width: 768px) {
    .globe-entry { padding: 7px 9px; gap: 5px; }
    .globe-entry .ge-lbl { font-size: 0.6rem; }
    .globe-entry .ge-idx { font-size: 0.7rem; }
    .globe-entry.ge-01, .globe-entry.ge-02 { top: 8%; }
    .globe-entry.ge-03, .globe-entry.ge-04 { bottom: 12%; }
    .globe-entry.ge-01 { left: 3%; } .globe-entry.ge-02 { right: 3%; }
    .globe-entry.ge-03 { left: 3%; } .globe-entry.ge-04 { right: 3%; }
    /* on phones move the China-dragon entry to mid-bottom so it never overlaps the top pair */
    .globe-entry.ge-05 { top: auto; bottom: 22%; left: 50%; }
    .globe-entry.ge-05:hover, .globe-entry.ge-05:focus-visible { transform: translateX(-50%) scale(1.05); }
    .globe-dossier { position: fixed; top: auto; bottom: 0; right: 0; left: 0; transform: none; width: 100%; max-height: 48%; border: none; border-top: 1px solid var(--line-2); }
    .board-drawer { height: 88vh; height: 88dvh; }
    .drawer-body { padding: 1.2rem 1rem 5rem; }
}

@media (max-width: 480px) {
    .globe-entry .ge-lbl { font-size: 0.6rem; }
    .globe-title { font-size: 1rem; letter-spacing: 2px; }
    .globe-sub { display: none; }
}

/* ---- one-tap translation ---- */
.tl-btn {
    font-family: var(--mono); font-size: 0.58rem; letter-spacing: 1px;
    color: var(--ink-3); border: 1px solid var(--line-2);
    padding: 1px 6px; margin-left: 8px; vertical-align: middle;
    transition: color .2s, border-color .2s; white-space: nowrap;
}
.tl-btn:hover { color: var(--red); border-color: var(--red); }
.tl-btn.on { color: var(--red); border-color: var(--red); }
.tl-btn[data-loading="true"] { opacity: 0.45; pointer-events: none; }
.tl-out {
    display: none; margin-top: 0.6rem; padding: 0.6rem 0.9rem;
    border-left: 2px solid var(--red); background: rgba(192,57,43,0.05);
    color: var(--ink); font-size: 0.92rem; line-height: 1.65;
    font-family: var(--serif);
}
.tl-out.show { display: block; animation: commentIn 0.3s var(--ease); }

/* optional geo fields in post modal */
.post-geo { margin-bottom: 1rem; }
.post-geo summary { cursor: pointer; color: var(--ink-3); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 1px; padding: 0.5rem 0; list-style: none; transition: color .2s; }
.post-geo summary::-webkit-details-marker { display: none; }
.post-geo summary::marker { content: ''; }
.post-geo summary:hover, .post-geo[open] summary { color: var(--red); }
.post-geo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 0.8rem; margin-top: 0.4rem; }
.post-geo-grid .brutal-input { margin-bottom: 0.6rem; font-size: 0.8rem; }

/* credibility vote bar */
.credibility { display: flex; align-items: center; gap: 0.8rem; margin: 1.2rem 0 0; padding-left: clamp(1rem,2vw,3rem); font-family: var(--mono); }
.cred-btn { font-size: 0.6rem; letter-spacing: 1px; color: var(--ink-3); border: 1px solid var(--line-2); padding: 3px 8px; transition: color .2s, border-color .2s; white-space: nowrap; -webkit-tap-highlight-color: transparent; }
.cred-btn.cred-up:hover { color: #4ec9b0; border-color: #4ec9b0; }
.cred-btn.cred-down:hover { color: var(--red); border-color: var(--red); }
.cred-btn b { color: var(--ink); }
.cred-bar { flex: 1; height: 3px; background: var(--line-2); position: relative; min-width: 40px; }
.cred-fill { position: absolute; left: 0; top: 0; height: 100%; background: #4ec9b0; box-shadow: 0 0 6px rgba(78,201,176,0.5); transition: width .45s var(--ease); }
.credibility.voted .cred-btn { opacity: 0.55; pointer-events: none; }
@media (max-width: 480px) { .credibility { padding-left: 0.6rem; gap: 0.5rem; flex-wrap: wrap; } }

/* admin console */
.admin-gear { font-size: 0.95rem; color: var(--ink-3); padding: 2px 5px; transition: color .2s, transform .35s var(--ease); flex: 0 0 auto; line-height: 1; }
.admin-gear:hover { color: var(--red); transform: rotate(90deg); }
.admin-box { max-width: min(1120px, 95vw); width: 95vw; height: min(90vh, 940px); display: flex; flex-direction: column; padding: clamp(1.1rem, 2.4vw, 1.9rem); }
.admin-box .modal-title { flex: 0 0 auto; }
.admin-box #admin-login { flex: 0 0 auto; }
.admin-box #admin-panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.admin-box .admin-stats { flex: 0 0 auto; }
.admin-box .admin-tabs { flex: 0 0 auto; position: relative; align-items: center; }
.admin-box .admin-search { flex: 0 0 auto; margin: 0 0 0.7rem; font-size: 0.72rem; padding: 0.5rem 0.7rem; }
.admin-scroll { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; padding-right: 4px; }
.admin-logout { margin-left: auto; color: var(--ink-3); border: 1px solid var(--line-2); width: 28px; height: 26px; font-size: 0.8rem; transition: color .2s, border-color .2s, background .2s; flex: 0 0 auto; align-self: center; }
.admin-logout:hover { color: #fff; background: var(--red); border-color: var(--red); }

/* stat bar highlights */
.admin-stats .adm-hl { color: #e0913a; }
.admin-stats .adm-hl2 { color: #4ec9b0; }

/* overview cards */
.adm-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.7rem; margin-bottom: 1.4rem; }
.adm-card { border: 1px solid var(--line-2); background: var(--bg-elev); padding: 0.9rem 1rem; font-family: var(--mono); }
.adm-card b { display: block; font-size: 1.7rem; color: var(--ink); line-height: 1; margin-bottom: 6px; }
.adm-card span { font-size: 0.56rem; letter-spacing: 1px; color: var(--ink-3); }
.adm-card-a { border-color: #e0913a; } .adm-card-a b { color: #e0913a; }
.adm-card-u { border-color: #4ec9b0; } .adm-card-u b { color: #4ec9b0; }
.adm-sub { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 2px; color: var(--red); margin: 1.2rem 0 0.7rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--line); }
.adm-cat { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.adm-cat-chip { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 1px; color: var(--ink-2); border: 1px solid var(--line-2); padding: 4px 10px; }
.adm-cat-chip b { color: var(--ink); }
.adm-hint { font-family: var(--mono); font-size: 0.66rem; line-height: 1.7; color: var(--ink-3); margin-top: 1.4rem; padding: 0.8rem 1rem; border-left: 2px solid var(--line-2); background: var(--bg-elev); }
.adm-count { font-family: var(--mono); font-size: 0.6rem; letter-spacing: 1.5px; color: var(--ink-3); margin-bottom: 0.7rem; }

/* accordion cards (agents + guests) */
.adm-acc { border: 1px solid var(--line); margin-bottom: 0.45rem; background: var(--bg-elev); }
.adm-acc.open { border-color: var(--line-2); }
.adm-acc-head { display: flex; align-items: center; gap: 0.8rem; width: 100%; text-align: left; padding: 0.65rem 0.9rem; font-family: var(--mono); cursor: pointer; }
.adm-acc-head:hover { background: #17150f; }
.adm-acc-name { color: var(--ink); font-size: 0.78rem; letter-spacing: 0.5px; flex: 0 0 auto; max-width: 38%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-acc-meta { color: var(--ink-2); font-size: 0.6rem; letter-spacing: 0.5px; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-acc-date { color: var(--ink-3); font-size: 0.56rem; flex: 0 0 auto; white-space: nowrap; }
.adm-acc-arrow { color: var(--ink-3); font-size: 0.7rem; flex: 0 0 auto; transition: transform .2s; }
.adm-acc.open .adm-acc-arrow { transform: rotate(90deg); color: var(--red); }
.adm-acc-body { padding: 0.3rem 0.9rem 0.7rem; border-top: 1px solid var(--line); }

/* registered user card */
.adm-user { border: 1px solid #4ec9b0; border-left-width: 3px; background: var(--bg-elev); padding: 0.9rem 1rem; margin-bottom: 0.7rem; font-family: var(--mono); }
.adm-user-head { display: flex; align-items: baseline; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 6px; }
.adm-user-name { color: #4ec9b0; font-size: 0.95rem; font-weight: 700; }
.adm-user-id { color: var(--ink-3); font-size: 0.62rem; }
.adm-user-tags { color: var(--ink-2); font-size: 0.6rem; letter-spacing: 0.5px; margin-left: auto; }
.adm-user-info { color: var(--ink-3); font-size: 0.6rem; letter-spacing: 0.5px; margin-bottom: 6px; }
.adm-user-bio { color: var(--ink-2); font-size: 0.68rem; line-height: 1.5; border-left: 2px solid var(--line-2); padding-left: 8px; margin-bottom: 8px; }
.adm-user-sec { font-family: var(--mono); font-size: 0.56rem; letter-spacing: 1.5px; color: var(--red); margin: 0.7rem 0 0.4rem; }

/* item rows (posts + comments) */
.adm-item { display: flex; align-items: center; gap: 0.7rem; padding: 0.42rem 0; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 0.68rem; }
.adm-item-cat { color: var(--red); flex: 0 0 auto; width: 86px; font-size: 0.54rem; letter-spacing: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-item-title { flex: 1; color: var(--ink); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--serif); font-size: 0.82rem; }
.adm-item-cmt .adm-item-title { font-family: var(--mono); font-size: 0.7rem; color: var(--ink-2); font-style: italic; }
.adm-item-on { color: var(--ink-3); font-size: 0.56rem; flex: 0 0 auto; max-width: 28%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-item-date, .adm-item-meta { color: var(--ink-3); font-size: 0.56rem; flex: 0 0 auto; white-space: nowrap; }
.admin-del[data-kind="comment"]:hover { background: #8a5a2b; border-color: #8a5a2b; }
@media (max-width: 640px) {
    .admin-box { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border: none; }
    .adm-item-cat, .adm-item-meta, .adm-acc-date, .adm-user-tags { display: none; }
    .adm-acc-name { max-width: 50%; }
}
#admin-error { font-family: var(--mono); font-size: 0.7rem; color: var(--red); margin-top: 0.7rem; min-height: 1em; letter-spacing: 1px; }
.admin-stats { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; font-family: var(--mono); font-size: 0.64rem; color: var(--ink-2); letter-spacing: 1px; margin-bottom: 1.2rem; padding-bottom: 0.9rem; border-bottom: 1px solid var(--line); }
.admin-posts-head { font-family: var(--mono); font-size: 0.6rem; color: var(--ink-3); letter-spacing: 2px; margin-bottom: 0.7rem; }
.admin-posts { max-height: 50vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.admin-row { display: flex; align-items: center; gap: 0.7rem; padding: 0.5rem 0; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 0.68rem; }
.admin-row-cat { color: var(--red); flex: 0 0 auto; width: 92px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.56rem; letter-spacing: 1px; }
.admin-row-title { flex: 1; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; font-family: var(--serif); font-size: 0.85rem; }
.admin-row-meta { color: var(--ink-3); font-size: 0.56rem; flex: 0 0 auto; white-space: nowrap; }
.admin-del { color: var(--ink-3); border: 1px solid var(--line-2); padding: 2px 9px; font-size: 0.56rem; letter-spacing: 1px; transition: color .2s, background .2s, border-color .2s; flex: 0 0 auto; }
.admin-del:hover { color: #fff; background: var(--red); border-color: var(--red); }
@media (max-width: 600px) { .admin-row-cat, .admin-row-meta { display: none; } }

/* admin tabs + agents table */
.admin-tabs { display: flex; margin-bottom: 0.8rem; border-bottom: 1px solid var(--line); }
.admin-tab { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 2px; color: var(--ink-3); padding: 0.5rem 1rem; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.admin-tab.active { color: var(--red); border-bottom-color: var(--red); }
.admin-tab:hover:not(.active) { color: var(--ink); }
.admin-users { max-height: 50vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.admin-row-h { color: var(--ink-3) !important; font-size: 0.56rem; letter-spacing: 1px; }
.au-id { flex: 1; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.admin-row-h .au-id { color: var(--ink-3); }
.au-n { flex: 0 0 auto; width: 46px; text-align: right; color: var(--ink-2); }
.au-ip { flex: 0 0 auto; width: 112px; color: var(--ink-3); font-size: 0.58rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.au-t { flex: 0 0 auto; width: 104px; color: var(--ink-3); font-size: 0.58rem; text-align: right; }
.admin-empty { color: var(--ink-3); font-family: var(--mono); font-size: 0.7rem; text-align: center; padding: 2rem 1rem; line-height: 1.6; }
@media (max-width: 600px) { .au-ip { display: none; } }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        transition-duration: 0.001ms !important;
    }
    .pulse::after,
    .divider-line::after,
    .spotlight,
    .scanlines,
    .crt-rollbar,
    .hud-scope { display: none; }
    .boot-screen { display: none !important; }
    .article-block { opacity: 1; transform: none; }
}

/* ============================================================
   FIELD REPORTS — user-pinned stories on a real dark map
   ============================================================ */
.globe-field-btn {
    font-family: var(--mono); font-size: 0.68rem; letter-spacing: 1px;
    color: var(--bg); background: var(--red); border: 1px solid var(--red);
    padding: 4px 11px; display: inline-flex; align-items: center; gap: 6px;
    flex: 0 0 auto; cursor: pointer; font-weight: 700;
    box-shadow: 0 0 14px rgba(192,57,43,0.4); transition: background .2s, box-shadow .2s, transform .15s;
}
.globe-field-btn:hover { background: var(--red-bright); box-shadow: 0 0 22px rgba(231,76,60,0.6); transform: translateY(-1px); }
.globe-field-btn .gfb-ico { animation: gfbPulse 2.2s ease-in-out infinite; }
@keyframes gfbPulse { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }
.globe-stat + .globe-field-btn { margin-left: 0; }

.field-board {
    position: fixed; inset: 0; z-index: 95; background: var(--bg);
    display: none; flex-direction: column;
}
.field-board.open { display: flex; }
.field-bar {
    flex: 0 0 auto; display: flex; align-items: center; gap: 0.9rem;
    padding: 0.6rem clamp(0.8rem, 2.2vw, 1.6rem);
    font-family: var(--mono); border-bottom: 1px solid var(--line-2);
    background: linear-gradient(180deg, var(--bg-elev), var(--bg)); z-index: 6;
}
.field-back {
    font-family: var(--mono); font-size: 0.7rem; letter-spacing: 1px; color: var(--ink-2);
    border: 1px solid var(--line-2); padding: 6px 11px; display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer; transition: color .2s, border-color .2s, background .2s; flex: 0 0 auto;
}
.field-back:hover { color: var(--red); border-color: var(--red); background: var(--red-faint); }
.field-back .fb-arrow { font-size: 0.8rem; }
.field-headings { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.field-title { font-family: var(--serif); font-weight: 900; font-size: clamp(1rem, 1.9vw, 1.5rem); letter-spacing: 3px; color: var(--ink); text-shadow: 0 0 18px rgba(192,57,43,0.35); line-height: 1; }
.field-sub { font-family: var(--mono); font-size: 0.58rem; letter-spacing: 1.5px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.field-stat { margin-left: auto; color: var(--red); font-size: 0.66rem; letter-spacing: 1px; white-space: nowrap; text-shadow: 0 0 6px rgba(192,57,43,0.4); }
.field-add { font-size: 0.7rem !important; padding: 7px 13px !important; flex: 0 0 auto; white-space: nowrap; }

.field-map { flex: 1; min-height: 0; width: 100%; background: #06090c; }
.leaflet-container { background: #06090c; font-family: var(--mono); }

/* Pin-mode hint banner */
.field-hint {
    position: absolute; top: calc(0.6rem + 52px); left: 50%; transform: translateX(-50%);
    z-index: 1200; background: rgba(14,13,11,0.95); border: 1px solid var(--red);
    color: var(--ink); font-family: var(--mono); font-size: 0.72rem; letter-spacing: 1px;
    padding: 9px 14px; align-items: center; gap: 14px;
    box-shadow: 0 0 24px rgba(192,57,43,0.5); animation: hintIn .3s var(--ease) both;
}
.field-hint:not([hidden]) { display: flex; }
@keyframes hintIn { from { opacity: 0; transform: translateX(-50%) translateY(-8px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
.field-hint-txt { color: var(--red-bright); }
.field-hint-cancel { font-family: var(--mono); font-size: 0.66rem; color: var(--ink-3); border: 1px solid var(--line-2); padding: 3px 8px; cursor: pointer; transition: color .2s, border-color .2s; }
.field-hint-cancel:hover { color: var(--red); border-color: var(--red); }
.field-board.pinning .field-map { cursor: crosshair; }

/* New-pin form panel (floats top-right over the map) */
.field-form {
    position: absolute; top: calc(0.6rem + 64px); right: clamp(0.8rem, 2.2vw, 1.6rem);
    width: min(370px, calc(100vw - 1.6rem)); z-index: 1300;
    background: var(--bg-modal); border: 1px solid var(--line-2);
    box-shadow: 0 18px 60px rgba(0,0,0,0.7), 0 0 30px rgba(192,57,43,0.18);
    padding: 1.2rem 1.2rem 1.3rem; font-family: var(--mono);
    animation: formIn .3s var(--ease) both; max-height: calc(100vh - 0.6rem - 80px); overflow-y: auto;
}
@keyframes formIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: translateX(0); } }
.field-form-title { font-family: var(--serif); font-weight: 900; font-size: 1.05rem; letter-spacing: 2px; color: var(--ink); margin: 0 0 4px; }
.field-coords { font-size: 0.62rem; letter-spacing: 1px; color: var(--red); margin-bottom: 0.8rem; word-break: break-all; }
.field-form .brutal-input { margin-bottom: 0.6rem; width: 100%; }
.field-photo-label {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    border: 1px dashed var(--line-2); color: var(--ink-3); font-size: 0.7rem; letter-spacing: 1px;
    padding: 12px; cursor: pointer; transition: color .2s, border-color .2s, background .2s; margin-bottom: 0.6rem;
}
.field-photo-label:hover { color: var(--red); border-color: var(--red); background: var(--red-faint); }
.field-photo-ico { font-size: 1rem; }
.field-photo-wrap { position: relative; margin-bottom: 0.7rem; }
.field-photo-preview { width: 100%; max-height: 200px; object-fit: cover; display: block; border: 1px solid var(--line-2); }
.field-photo-clear {
    position: absolute; top: 6px; right: 6px; width: 26px; height: 26px;
    background: rgba(7,8,7,0.85); border: 1px solid var(--line-2); color: var(--ink);
    cursor: pointer; font-size: 0.8rem; transition: color .2s, border-color .2s;
}
.field-photo-clear:hover { color: var(--red); border-color: var(--red); }
.field-form-err { color: var(--red-bright); font-size: 0.68rem; letter-spacing: 0.5px; margin-top: 0.5rem; min-height: 1em; }
.field-form-err.ok { color: #4ec9b0; }

/* Leaflet zoom control — dark theme */
.leaflet-bar a, .leaflet-bar a:hover {
    background: var(--bg-elev); color: var(--ink-2); border-bottom-color: var(--line);
    width: 30px; height: 30px; line-height: 30px; font-family: var(--mono);
}
.leaflet-bar a:hover { color: var(--red); }
.leaflet-bar { border: 1px solid var(--line-2); box-shadow: 0 0 16px rgba(0,0,0,0.6); }
.leaflet-control-attribution {
    background: rgba(10,10,9,0.78) !important; color: var(--ink-3) !important;
    font-family: var(--mono); font-size: 9px;
}
.leaflet-control-attribution a { color: var(--ink-2) !important; }

/* Custom anomaly marker — content centered on the icon's anchor (no transform-translate,
   so the dot sits exactly on its lat/lng at every zoom level). */
/* Keep Leaflet's absolute positioning. A `position: relative` override drops markers into
   normal flow so they STACK (each ~11px) and drift vertically — that was the zoom bug. */
.fr-marker.leaflet-marker-icon { position: absolute; }
.fr-marker-dot, .fr-marker-pulse {
    position: absolute; inset: 0; margin: auto;
    width: 16px; height: 16px; box-sizing: border-box; border-radius: 50%;
}
.fr-marker-dot {
    background: radial-gradient(circle at 35% 30%, #ff7a5c, var(--red));
    border: 2px solid #ffd9cf; box-shadow: 0 0 10px var(--red), 0 0 22px rgba(192,57,43,0.6);
}
.fr-marker-pulse {
    border: 2px solid var(--red-bright); transform-origin: center center;
    animation: frPing 2s ease-out infinite;
}
@keyframes frPing { 0% { opacity: 0.9; transform: scale(0.5); } 100% { opacity: 0; transform: scale(3.2); } }

/* Leaflet popup — dark dossier card */
.leaflet-popup-content-wrapper {
    background: var(--bg-modal); color: var(--ink); border: 1px solid var(--line-2);
    border-radius: 0; box-shadow: 0 16px 50px rgba(0,0,0,0.7), 0 0 26px rgba(192,57,43,0.16);
}
.leaflet-popup-tip { background: var(--bg-modal); border: 1px solid var(--line-2); }
.leaflet-popup-content { margin: 0; font-family: var(--mono); width: 260px !important; }
.leaflet-popup-close-button { color: var(--ink-3) !important; }
.leaflet-popup-close-button:hover { color: var(--red) !important; }
.fr-pop { padding: 0; }
.fr-pop-photo { width: 100%; height: 150px; object-fit: cover; display: block; border-bottom: 1px solid var(--line-2); background: #06090c; }
.fr-pop-body { padding: 11px 13px 13px; }
.fr-pop-title { font-family: var(--serif); font-weight: 700; font-size: 0.98rem; color: var(--ink); line-height: 1.3; margin-bottom: 5px; }
.fr-pop-place { font-size: 0.6rem; letter-spacing: 1px; color: var(--red); margin-bottom: 8px; }
.fr-pop-story { font-size: 0.74rem; line-height: 1.6; color: var(--ink-2); white-space: pre-wrap; max-height: 160px; overflow-y: auto; }
.fr-pop-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 9px; padding-top: 8px; border-top: 1px solid var(--line); font-size: 0.58rem; letter-spacing: 0.5px; color: var(--ink-3); }
.fr-pop-author { color: var(--ink); }

@media (max-width: 640px) {
    .field-bar { flex-wrap: wrap; gap: 0.5rem 0.7rem; padding: 0.5rem 0.7rem; }
    .field-headings { order: 3; flex: 1 1 100%; }
    .field-title { font-size: 0.95rem; letter-spacing: 2px; }
    .field-sub { font-size: 0.52rem; }
    .field-stat { order: 1; margin-left: 0; }
    .field-add { order: 2; margin-left: auto; }
    .field-form {
        top: auto; bottom: 0; right: 0; left: 0; width: 100%;
        max-height: 82vh; border-left: none; border-right: none; border-bottom: none;
        animation: formInMob .3s var(--ease) both;
    }
    @keyframes formInMob { from { transform: translateY(100%); } to { transform: translateY(0); } }
    .field-hint { width: calc(100% - 1.2rem); font-size: 0.62rem; flex-direction: column; gap: 7px; text-align: center; }
    .ui-field-btn, #ui-field-btn { display: none; }
    .globe-field-btn { padding: 4px 8px; }
}

/* ============================================================
   LATEST DISPATCHES — chronological forum-style feed
   ============================================================ */
.globe-feed-btn {
    font-family: var(--mono); font-size: 0.68rem; letter-spacing: 1px; font-weight: 700;
    color: var(--ink-2); background: transparent; border: 1px solid var(--line-2);
    padding: 4px 11px; display: inline-flex; align-items: center; gap: 7px;
    flex: 0 0 auto; cursor: pointer; transition: color .2s, border-color .2s, background .2s;
}
.globe-feed-btn:hover { color: var(--ink); border-color: #4ec9b0; background: rgba(78,201,176,0.08); }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ec9b0; box-shadow: 0 0 8px #4ec9b0; animation: liveBlink 1.6s ease-in-out infinite; }
@keyframes liveBlink { 0%,100% { opacity: 1; } 50% { opacity: 0.25; } }

.feed-board { position: fixed; inset: 0; z-index: 95; background: var(--bg); display: none; flex-direction: column; }
.feed-board.open { display: flex; }
.feed-bar {
    flex: 0 0 auto; display: flex; align-items: center; gap: 0.8rem; flex-wrap: wrap;
    padding: 0.6rem clamp(0.8rem, 2.2vw, 1.6rem);
    font-family: var(--mono); border-bottom: 1px solid var(--line-2);
    background: linear-gradient(180deg, var(--bg-elev), var(--bg)); z-index: 6;
}
.feed-filters { display: inline-flex; border: 1px solid var(--line-2); }
.feed-filter {
    font-family: var(--mono); font-size: 0.64rem; letter-spacing: 1px; color: var(--ink-3);
    background: transparent; padding: 6px 11px; cursor: pointer; border: none;
    border-right: 1px solid var(--line-2); transition: color .2s, background .2s;
}
.feed-filter:last-child { border-right: none; }
.feed-filter:hover { color: var(--ink); }
.feed-filter.active { color: var(--bg); background: #4ec9b0; font-weight: 700; }
.feed-refresh {
    font-family: var(--mono); font-size: 0.66rem; letter-spacing: 1px; color: var(--ink-2);
    border: 1px solid var(--line-2); padding: 6px 11px; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
    transition: color .2s, border-color .2s; flex: 0 0 auto;
}
.feed-refresh:hover { color: #4ec9b0; border-color: #4ec9b0; }
.feed-refresh .fr-spin { display: inline-block; font-size: 0.85rem; }
.feed-refresh.spinning .fr-spin { animation: frSpin .7s linear infinite; }
@keyframes frSpin { to { transform: rotate(360deg); } }

.feed-list { flex: 1; min-height: 0; overflow-y: auto; padding: 0 clamp(0.6rem, 2vw, 1.4rem) 2rem; }
.feed-list-inner { max-width: 920px; margin: 0 auto; }
.feed-day {
    position: sticky; top: 0; z-index: 2; background: var(--bg);
    font-family: var(--mono); font-size: 0.62rem; letter-spacing: 2px; color: var(--red);
    padding: 0.9rem 0 0.5rem; border-bottom: 1px solid var(--line); margin-bottom: 0.4rem;
    display: flex; align-items: center; gap: 10px;
}
.feed-day::before { content: "▍"; color: var(--red); }
.feed-day .fd-count { color: var(--ink-3); letter-spacing: 1px; }
.feed-item {
    position: relative; display: block; width: 100%; text-align: left; cursor: pointer;
    background: var(--bg-elev); border: 1px solid var(--line); border-left: 3px solid var(--cc, var(--line-2));
    padding: 0.85rem 1rem 0.85rem 1.1rem; margin-bottom: 0.5rem; font-family: var(--mono);
    transition: border-color .18s, background .18s, transform .12s;
}
.feed-item:hover { background: #17150f; border-color: var(--line-2); border-left-color: var(--cc, var(--red)); transform: translateX(2px); }
.feed-item-top { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.feed-item-cat { font-size: 0.56rem; letter-spacing: 1.5px; color: var(--cc, var(--ink-3)); border: 1px solid var(--cc, var(--line-2)); padding: 2px 7px; text-transform: uppercase; white-space: nowrap; }
.feed-item-time { font-size: 0.58rem; letter-spacing: 0.5px; color: var(--ink-3); margin-left: auto; }
.feed-item-title { font-family: var(--serif); font-weight: 700; font-size: 1.02rem; line-height: 1.35; color: var(--ink); margin-bottom: 5px; }
.feed-item:hover .feed-item-title { color: #fff; }
.feed-item-snippet { font-size: 0.76rem; line-height: 1.55; color: var(--ink-3); margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-item-meta { display: flex; align-items: center; gap: 14px; font-size: 0.6rem; letter-spacing: 0.5px; color: var(--ink-3); }
.feed-item-meta .fm-author { color: var(--ink-2); }
.feed-item-meta .fm-stat { display: inline-flex; align-items: center; gap: 4px; }
.feed-item-meta .fm-stat.hot { color: var(--red); }
.feed-empty { text-align: center; color: var(--ink-3); font-family: var(--mono); font-size: 0.8rem; letter-spacing: 1px; padding: 3rem 1rem; }

/* detail panel */
.feed-detail { position: absolute; inset: 0; top: 0; z-index: 10; background: var(--bg); flex-direction: column; animation: detIn .28s var(--ease) both; }
.feed-detail:not([hidden]) { display: flex; }
@keyframes detIn { from { opacity: 0; transform: translateX(18px); } to { opacity: 1; transform: translateX(0); } }
.feed-detail-bar { flex: 0 0 auto; padding: 0.6rem clamp(0.8rem, 2.2vw, 1.6rem); border-bottom: 1px solid var(--line-2); background: var(--bg-elev); }
.feed-detail-body { flex: 1; min-height: 0; overflow-y: auto; padding: 1.2rem clamp(0.8rem, 2vw, 1.4rem) 3rem; }
.feed-detail-body .article-block { max-width: 860px; margin: 0 auto; opacity: 1; transform: none; }

@media (max-width: 640px) {
    .feed-bar { gap: 0.5rem 0.6rem; padding: 0.5rem 0.7rem; }
    .feed-board .field-headings { order: -1; flex: 1 1 auto; }
    .feed-board .field-title { font-size: 0.95rem; letter-spacing: 2px; }
    .feed-board .field-sub { font-size: 0.52rem; }
    .feed-filters { order: 3; }
    .feed-refresh { order: 4; }
    .feed-post-btn, #feed-post-btn { order: 5; margin-left: auto; }
    .feed-item-title { font-size: 0.95rem; }
    #ui-feed-refresh, #ui-feed-btn { display: none; }
    .globe-feed-btn { padding: 4px 8px; }
}

/* ===== 卷宗解密影像 ARCHIVE FOOTAGE ===== */
.dossier-video{
    margin:1.4rem 0; border:1px solid var(--red); background:#000;
    box-shadow:0 0 0 1px rgba(0,0,0,.6), 0 0 18px rgba(192,57,43,.18);
}
.dossier-video-head{
    font-family:'Space Mono',monospace; font-size:.72rem; letter-spacing:.14em;
    text-transform:uppercase; color:#fff; background:var(--red); padding:.5rem .8rem;
}
.dossier-video-frame{ position:relative; width:100%; aspect-ratio:16/9; background:#000; }
.dossier-video-frame iframe{ position:absolute; inset:0; width:100%; height:100%; border:0; display:block; }
.dossier-video-cap{
    font-family:'Space Mono',monospace; font-size:.66rem; line-height:1.5; color:var(--ink-3);
    padding:.55rem .8rem; background:var(--bg-elev);
    border-top:1px dashed rgba(192,57,43,.35);
    display:flex; justify-content:space-between; gap:1rem; flex-wrap:wrap;
}
.dossier-video-cap .dv-src{ color:var(--red); white-space:nowrap; opacity:.85; }
@media (max-width:480px){ .dossier-video-head{font-size:.64rem;} .dossier-video-cap{font-size:.6rem;} }

/* ============================================================
   INVITE SYSTEM — the rite of initiation + the sigil + lineage
   A sacred gold register, set apart from the red conspiracy theme.
   ============================================================ */
:root { --sacred: #c9a85c; --sacred-dim: #8a7339; --sacred-glow: rgba(201,168,92,0.35); }

/* the rite banner shown when initiating */
.auth-rite {
    display: flex; align-items: center; gap: 0.9rem; margin: 0.2rem 0 1rem;
    padding: 0.8rem 1rem; border: 1px solid var(--sacred-dim);
    background: linear-gradient(135deg, rgba(201,168,92,0.07), rgba(201,168,92,0.01));
    position: relative;
}
.auth-rite::before, .auth-rite::after {
    content: ""; position: absolute; width: 8px; height: 8px; border: 1px solid var(--sacred);
}
.auth-rite::before { top: -1px; left: -1px; border-right: none; border-bottom: none; }
.auth-rite::after { bottom: -1px; right: -1px; border-left: none; border-top: none; }
.rite-mark { font-size: 1.7rem; color: var(--sacred); text-shadow: 0 0 14px var(--sacred-glow); line-height: 1; flex: 0 0 auto; animation: riteGlow 3s ease-in-out infinite; }
@keyframes riteGlow { 0%,100% { opacity: 0.7; } 50% { opacity: 1; text-shadow: 0 0 20px var(--sacred-glow); } }
.rite-text { font-family: var(--serif); font-size: 0.92rem; color: var(--ink); letter-spacing: 1px; line-height: 1.5; }
.rite-en { font-family: var(--mono); font-size: 0.56rem; letter-spacing: 2px; color: var(--sacred); }
.auth-invite-field { letter-spacing: 3px; text-transform: uppercase; border-color: var(--sacred-dim) !important; }
.auth-invite-field:focus { border-color: var(--sacred) !important; box-shadow: 0 0 0 2px var(--sacred-glow) !important; }
.auth-invite-field::placeholder { letter-spacing: 1px; text-transform: none; }

/* the sigil block in the agent dossier */
.sigil-block {
    margin-top: 1.4rem; padding: 1.2rem 1.1rem 1.1rem; position: relative;
    border: 1px solid var(--sacred-dim);
    background: radial-gradient(120% 80% at 50% 0%, rgba(201,168,92,0.08), transparent 70%), var(--bg-elev);
    text-align: center;
}
.sigil-rune { font-size: 1.5rem; color: var(--sacred); text-shadow: 0 0 16px var(--sacred-glow); margin-bottom: 4px; animation: riteGlow 3.4s ease-in-out infinite; }
.sigil-label { font-family: var(--mono); font-size: 0.58rem; letter-spacing: 3px; color: var(--sacred); margin-bottom: 0.7rem; }
.sigil-code-row { display: flex; align-items: stretch; justify-content: center; gap: 0; margin-bottom: 0.6rem; }
.sigil-code {
    font-family: var(--mono); font-size: 1.35rem; font-weight: 700; letter-spacing: 8px;
    color: #f3e6c4; text-shadow: 0 0 18px var(--sacred-glow); padding: 0.5rem 0.4rem 0.5rem 1.2rem;
    border: 1px solid var(--sacred-dim); border-right: none; background: rgba(0,0,0,0.3); user-select: all;
}
.sigil-copy {
    font-family: var(--mono); font-size: 0.6rem; letter-spacing: 1px; color: var(--bg);
    background: var(--sacred); border: 1px solid var(--sacred); padding: 0 0.9rem; cursor: pointer;
    transition: background .2s, color .2s; flex: 0 0 auto; font-weight: 700;
}
.sigil-copy:hover { background: #e3cd8c; }
.sigil-uses { font-family: var(--mono); font-size: 0.68rem; letter-spacing: 0.5px; color: var(--ink-2); }
.sigil-uses b { color: var(--sacred); }
.sigil-note { font-family: var(--serif); font-size: 0.74rem; color: var(--ink-3); margin-top: 0.4rem; letter-spacing: 0.5px; }

.circle-head { font-family: var(--mono); font-size: 0.62rem; letter-spacing: 2px; color: var(--sacred); margin: 1.3rem 0 0.6rem; padding-top: 0.9rem; border-top: 1px solid var(--sacred-dim); text-align: left; }
.sigil-circle { text-align: left; }
.circle-empty { font-family: var(--serif); font-size: 0.78rem; color: var(--ink-3); text-align: center; padding: 1.2rem 0.5rem; line-height: 1.6; }
.circle-empty.small { padding: 0.6rem; font-size: 0.7rem; }
.circle-member { border: 1px solid var(--line); margin-bottom: 0.4rem; background: var(--bg); }
.circle-member.open { border-color: var(--sacred-dim); }
.circle-mhead { display: flex; align-items: center; gap: 0.6rem; width: 100%; text-align: left; padding: 0.55rem 0.7rem; font-family: var(--mono); cursor: pointer; }
.circle-mhead:hover { background: rgba(201,168,92,0.06); }
.cm-name { color: var(--sacred); font-size: 0.74rem; flex: 0 0 auto; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cm-meta { color: var(--ink-2); font-size: 0.58rem; flex: 1; min-width: 0; }
.cm-date { color: var(--ink-3); font-size: 0.54rem; flex: 0 0 auto; }
.cm-arrow { color: var(--sacred); font-size: 0.66rem; flex: 0 0 auto; transition: transform .2s; }
.circle-member.open .cm-arrow { transform: rotate(90deg); }
.circle-posts { padding: 0.2rem 0.7rem 0.5rem; border-top: 1px solid var(--line); }
.circle-post { display: flex; align-items: center; gap: 0.6rem; padding: 0.35rem 0; border-bottom: 1px solid var(--line); font-family: var(--mono); }
.circle-post:last-child { border-bottom: none; }
.cp-cat { color: var(--red); font-size: 0.5rem; letter-spacing: 1px; flex: 0 0 auto; width: 74px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-title { flex: 1; color: var(--ink); font-family: var(--serif); font-size: 0.78rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-date { color: var(--ink-3); font-size: 0.52rem; flex: 0 0 auto; }

/* admin invites view */
.adm-mint-row { margin-bottom: 1rem; }
.adm-mint-row .brutal-btn { font-size: 0.66rem; padding: 0.5rem 0.9rem; border-color: var(--sacred-dim); color: var(--sacred); }
.adm-mint-row .brutal-btn:hover { background: var(--sacred); color: var(--bg); border-color: var(--sacred); }
.adm-inv-code { font-family: var(--mono); font-weight: 700; letter-spacing: 3px; color: #f3e6c4; flex: 0 0 auto; width: 120px; }
.adm-inv-owner { flex: 1; color: var(--ink-2); font-size: 0.64rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adm-inv-uses { font-family: var(--mono); font-size: 0.66rem; color: var(--sacred); flex: 0 0 auto; }
.adm-inv-uses.full { color: var(--red); }
@media (max-width: 640px) { .adm-inv-code { width: 90px; letter-spacing: 1px; } }
.dossier-video-frame video{position:absolute;inset:0;width:100%;height:100%;border:0;display:block;background:#000;object-fit:contain;}
.post-vid-row{display:block;font-family:'Space Mono',monospace;font-size:.7rem;color:var(--ink-3);margin:.4rem 0 .2rem;}
.post-vid-status{font-family:'Space Mono',monospace;font-size:.7rem;color:var(--red-bright);min-height:1em;}
#post-video{font-size:.74rem;padding:.4rem;}

/* ============================================================
   FIELD REPORTS — pin detail + comments (full story view)
   ============================================================ */
.field-detail { position: absolute; inset: 0; z-index: 1350; background: var(--bg); flex-direction: column; animation: detIn .28s var(--ease) both; }
.field-detail:not([hidden]) { display: flex; }
.field-detail-bar { flex: 0 0 auto; padding: 0.6rem clamp(0.8rem, 2.2vw, 1.6rem); border-bottom: 1px solid var(--line-2); background: var(--bg-elev); }
.field-detail-body { flex: 1; min-height: 0; overflow-y: auto; padding: 0 clamp(0.9rem, 2.5vw, 2rem) 3rem; }
.field-detail-body > * { max-width: 720px; margin-left: auto; margin-right: auto; }
.fd-loading { text-align: center; color: var(--ink-3); font-family: var(--mono); padding: 3rem; letter-spacing: 1px; }
.fd-photo { width: 100%; max-height: 440px; object-fit: cover; display: block; margin-top: 1.3rem; border: 1px solid var(--line-2); }
.fd-title { font-family: var(--serif); font-weight: 900; font-size: clamp(1.3rem, 3vw, 2rem); color: var(--ink); line-height: 1.25; margin-top: 1.3rem; margin-bottom: 0.4rem; }
.fd-place { font-family: var(--mono); font-size: 0.7rem; letter-spacing: 1px; color: var(--red); margin-bottom: 0.5rem; }
.fd-meta { font-family: var(--mono); font-size: 0.66rem; color: var(--ink-3); margin-bottom: 1rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--line); }
.fd-meta .author-link { color: var(--ink-2); }
.fd-story { font-family: var(--serif); font-size: 1.02rem; line-height: 1.85; color: var(--ink-2); white-space: pre-wrap; margin-bottom: 2rem; }
.fd-cmt-section { font-family: var(--mono); font-size: 0.66rem; letter-spacing: 2px; color: var(--red); margin-bottom: 0.9rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--line); }
.fd-cmts { margin-bottom: 1.2rem; }
.fd-cmt { padding: 0.7rem 0; border-bottom: 1px solid var(--line); }
.fd-cmt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 4px; font-family: var(--mono); }
.fd-cmt-head .author-link { color: var(--ink); font-size: 0.72rem; }
.fd-cmt-date { color: var(--ink-3); font-size: 0.56rem; flex: 0 0 auto; }
.fd-cmt-text { font-family: var(--serif); font-size: 0.92rem; line-height: 1.6; color: var(--ink-2); white-space: pre-wrap; }
.fd-cmt-empty { font-family: var(--serif); color: var(--ink-3); font-size: 0.86rem; padding: 1rem 0; }
.fd-cmt-form { display: flex; gap: 0.6rem; }
.fd-cmt-form .brutal-input { flex: 1; }
.fd-cmt-form .brutal-btn { flex: 0 0 auto; }
@media (max-width: 640px) { .fd-cmt-form { flex-direction: column; } .fd-title { font-size: 1.25rem; } }

/* ============================================================
   PRIVATE MESSAGES (DM)
   ============================================================ */
.dm-btn {
    position: relative; font-size: 0.95rem; color: var(--ink-2); border: 1px solid var(--line-2);
    width: 30px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
    transition: color .2s, border-color .2s; flex: 0 0 auto;
}
.dm-btn:hover { color: #4ec9b0; border-color: #4ec9b0; }
.dm-badge {
    position: absolute; top: -7px; right: -7px; min-width: 16px; height: 16px; padding: 0 4px;
    background: var(--red); color: #fff; font-family: var(--mono); font-size: 0.56rem; font-weight: 700;
    border-radius: 8px; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 8px rgba(192,57,43,0.7);
}
.um-actions { display: flex; gap: 0.6rem; }
.um-actions .brutal-btn { flex: 1; }
#um-message { border-color: #4ec9b0; color: #4ec9b0; }
#um-message:hover { background: #4ec9b0; color: var(--bg); }

.dm-box { max-width: min(880px, 95vw); width: 95vw; height: min(82vh, 720px); display: flex; flex-direction: column; padding: clamp(1rem,2.2vw,1.6rem); }
.dm-box .modal-title { flex: 0 0 auto; }
.dm-layout { flex: 1; min-height: 0; display: flex; gap: 0; border: 1px solid var(--line-2); margin-top: 0.6rem; }
.dm-list { flex: 0 0 38%; max-width: 300px; overflow-y: auto; border-right: 1px solid var(--line-2); scrollbar-width: thin; }
.dm-conv { display: flex; align-items: center; gap: 0.6rem; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); cursor: pointer; font-family: var(--mono); transition: background .15s; }
.dm-conv:hover, .dm-conv.active { background: var(--bg-elev); }
.dm-conv.active { border-left: 3px solid #4ec9b0; }
.dm-conv-av { width: 30px; height: 30px; flex: 0 0 auto; display: flex; align-items: center; justify-content: center; border: 1px solid var(--line-2); color: #4ec9b0; font-size: 0.9rem; }
.dm-conv-main { flex: 1; min-width: 0; }
.dm-conv-name { color: var(--ink); font-size: 0.74rem; display: flex; justify-content: space-between; gap: 6px; }
.dm-conv-name b { color: var(--ink); }
.dm-conv-time { color: var(--ink-3); font-size: 0.54rem; font-weight: 400; flex: 0 0 auto; }
.dm-conv-last { color: var(--ink-3); font-size: 0.64rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin-top: 2px; }
.dm-conv-unread { background: var(--red); color: #fff; font-size: 0.54rem; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px; display: inline-flex; align-items: center; justify-content: center; padding: 0 4px; flex: 0 0 auto; }
.dm-empty { color: var(--ink-3); font-family: var(--mono); font-size: 0.72rem; text-align: center; padding: 2.5rem 1rem; line-height: 1.7; }

.dm-thread { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dm-thread-head { flex: 0 0 auto; padding: 0.6rem 0.9rem; border-bottom: 1px solid var(--line-2); font-family: var(--mono); font-size: 0.74rem; color: #4ec9b0; display: flex; align-items: center; gap: 8px; min-height: 20px; }
.dm-back { display: none; background: none; border: 1px solid var(--line-2); color: var(--ink-2); font-size: 0.7rem; padding: 2px 8px; cursor: pointer; }
.dm-thread-body { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem 0.9rem; display: flex; flex-direction: column; gap: 0.5rem; }
.dm-msg { max-width: 78%; padding: 0.5rem 0.75rem; font-family: var(--serif); font-size: 0.9rem; line-height: 1.5; word-break: break-word; white-space: pre-wrap; }
.dm-msg.theirs { align-self: flex-start; background: var(--bg-elev); border: 1px solid var(--line-2); color: var(--ink); }
.dm-msg.mine { align-self: flex-end; background: rgba(78,201,176,0.14); border: 1px solid #4ec9b0; color: var(--ink); }
.dm-msg-time { display: block; font-family: var(--mono); font-size: 0.5rem; color: var(--ink-3); margin-top: 3px; }
.dm-compose { flex: 0 0 auto; display: flex; gap: 0.5rem; padding: 0.6rem; border-top: 1px solid var(--line-2); }
.dm-compose .brutal-input { flex: 1; margin: 0; }
.dm-compose .brutal-btn { flex: 0 0 auto; }
.dm-pick { color: var(--ink-3); font-family: var(--mono); font-size: 0.74rem; text-align: center; margin: auto; padding: 2rem; }

@media (max-width: 640px) {
    .dm-box { width: 100vw; max-width: 100vw; height: 100vh; max-height: 100vh; border: none; }
    .dm-list { flex-basis: 100%; max-width: none; border-right: none; }
    .dm-layout.thread-open .dm-list { display: none; }
    .dm-thread { display: none; }
    .dm-layout.thread-open .dm-thread { display: flex; }
    .dm-back { display: inline-block; }
}
