body {
    margin: 0;
    background: #0f1720;
    color: #e8edf2;
    font-family: Arial, sans-serif;
    font-size: 15px;
}

/* ── Navigation ── */
.nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 12px;
    background: #17212b;
    border-bottom: 1px solid #263545;
    position: sticky;
    top: 0;
    z-index: 10;
}

.nav a {
    color: #7cc7ff;
    text-decoration: none;
    font-weight: bold;
}

.nav a:hover {
    text-decoration: underline;
}

.nav a.active {
    color: #ffffff;
    border-bottom: 2px solid #5ea2d8;
}

/* ── Page chrome ── */
.page-title {
    text-align: center;
    font-size: 22px;
    font-weight: bold;
    margin: 20px 0 10px 0;
    color: #dbe9f4;
}

.sneed {
    text-align: center;
    font-family: 'Brush Script MT', 'Segoe Script', cursive;
    font-size: 2.5rem;
    font-weight: normal;
    margin: 20px 0 10px;
    background: linear-gradient(45deg, #ff4da6, #ff99cc, #ff66b2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow:
        0 0 5px rgba(255, 105, 180, 0.6),
        0 0 10px rgba(255, 105, 180, 0.5),
        0 0 20px rgba(255, 105, 180, 0.4);
    letter-spacing: 1px;
    animation: shimmer 3s infinite linear;
}

@keyframes shimmer {
    0%   { background-position: -200px; }
    100% { background-position:  200px; }
}

/* ── Message list ── */
.messages {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.message {
    background: #182533;
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .2);
    position: relative;
}

.message-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 6px;
}

.sender {
    font-weight: bold;
    color: #6ab7ff;
}

.time {
    color: #9aa8b5;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}

.text {
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}

/* ── Reply preview ── */
.reply-preview-link {
    display: block;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.reply-preview-link * {
    pointer-events: none;
}

.reply-preview {
    border-left: 3px solid #5ea2d8;
    background: #101a24;
    padding: 6px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
}

.reply-sender {
    color: #7cc7ff;
    font-weight: bold;
    font-size: 13px;
}

.reply-text {
    color: #c8d1da;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Media ── */
.media-block {
    margin-top: 8px;
}

.media-photo a {
    display: inline-block; /* click area matches the image, not the full card width */
}

.media-photo img {
    display: block;
    max-width: 100%;
    max-height: 480px;
    border-radius: 8px;
    cursor: zoom-in;
    object-fit: contain;
}

.media-audio audio {
    display: block;
    width: 100%;
    max-width: 480px;
    height: 42px;
}

.media-video video {
    display: block;
    max-width: 100%;
    border-radius: 8px;
    background: #000;
}

.media-download {
    margin-top: 4px;
    font-size: 12px;
}

.media-download a,
.media-file a {
    color: #65d58b;
    text-decoration: none;
    font-weight: bold;
}

.media-download a:hover,
.media-file a:hover {
    text-decoration: underline;
}

.media-type {
    color: #9ecbff;
    margin-right: 4px;
    font-size: 13px;
}

/* ── Message meta ── */
.message-meta {
    color: #4a5a6a;
    font-size: 11px;
    margin-top: 8px;
    user-select: text;
    cursor: text;
}

/* ── Target / anchor highlight ── */
.message:target,
.target-message {
    outline: 2px solid #5ea2d8;
    background: #1e3248;
    scroll-margin-top: 60px;
}

/* ── Context link (njf / voice) ── */
.context-link {
    margin-top: 6px;
    font-size: 12px;
}

.context-link a {
    color: #9ecbff;
    text-decoration: none;
}

.context-link a:hover {
    text-decoration: underline;
}

/* ── Load more (context.php) ── */
.load-more {
    max-width: 900px;
    margin: 0 auto;
    padding: 4px 20px 12px;
    text-align: center;
}

.load-more a {
    display: inline-block;
    background: #182533;
    color: #7cc7ff;
    padding: 9px 20px;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #263545;
    font-size: 14px;
    transition: background 0.15s;
}

.load-more a:hover {
    background: #1e3045;
}

.context-edge {
    text-align: center;
    color: #4a5a6a;
    font-size: 13px;
    padding: 8px 20px 14px;
}

/* ── Pagination ── */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 24px;
}

.pagination a {
    background: #182533;
    color: #dbe9f4;
    padding: 8px 14px;
    border-radius: 8px;
    text-decoration: none;
    border: 1px solid #263545;
    transition: background 0.15s;
}

.pagination a:hover {
    background: #1e3045;
}

.pagination-info {
    color: #9aa8b5;
    font-size: 14px;
}

/* ── Filter form ── */
.filter-form {
    max-width: 900px;
    margin: 0 auto 16px auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    gap: 8px;
    align-items: center;
}

.filter-form input {
    background: #101a24;
    color: #e8edf2;
    border: 1px solid #263545;
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 14px;
}

.filter-form button {
    background: #2d6ea3;
    color: white;
    border: 0;
    border-radius: 8px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 14px;
}

.filter-form button:hover {
    background: #3580bb;
}

/* ── Back to top (injected by JS, invisible without it) ── */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: #2d6ea3;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s, background 0.15s;
    z-index: 200;
    box-shadow: 0 2px 8px rgba(0,0,0,.4);
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    background: #3580bb;
}

/* ── Reply jump flash highlight ── */
@keyframes flash-highlight {
    0%   { background: #1a3f63; outline: 2px solid #7cc7ff; }
    100% { background: #182533; outline: 2px solid transparent; }
}

.flash-highlight {
    animation: flash-highlight 1.5s ease-out;
}

/* ── Login page ── */
.login-wrap {
    max-width: 340px;
    margin: 60px auto 0;
    padding: 0 16px;
}
.login-card {
    background: #182533;
    border-radius: 12px;
    padding: 28px 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.login-card h1 {
    margin: 0 0 24px;
    font-size: 18px;
    font-weight: bold;
    color: #dbe9f4;
    text-align: center;
}
.login-field { margin-bottom: 14px; }
.login-field label {
    display: block;
    font-size: 12px;
    color: #9aa8b5;
    margin-bottom: 5px;
}
.login-field input {
    display: block;
    width: 100%;
    background: #101a24;
    color: #e8edf2;
    border: 1px solid #263545;
    border-radius: 8px;
    padding: 9px 10px;
    font-size: 14px;
    box-sizing: border-box;
    outline: none;
    font-family: Arial, sans-serif;
    -webkit-appearance: none;
}
.login-field input:focus { border-color: #5ea2d8; }
.login-submit {
    display: block;
    width: 100%;
    margin-top: 20px;
    background: #2d6ea3;
    color: white;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    cursor: pointer;
    font-size: 14px;
    font-family: Arial, sans-serif;
}
.login-submit:hover { background: #3580bb; }
.login-error {
    background: rgba(200,50,50,.12);
    border: 1px solid rgba(200,50,50,.3);
    color: #ff7070;
    font-size: 13px;
    border-radius: 8px;
    padding: 9px 12px;
    margin-bottom: 16px;
    text-align: center;
}
.login-blocked {
    color: #9aa8b5;
    font-size: 14px;
    text-align: center;
    line-height: 1.5;
}

/* ── Mobile ── */
@media (max-width: 600px) {
    .messages {
        padding: 10px;
    }

    .message {
        padding: 10px 12px;
    }

    .media-audio audio {
        max-width: 100%;
    }

    .time {
        font-size: 11px;
    }

    .message-meta {
        display: none;
    }
}

