/*
Theme Name: Melayu
Theme URI: http://localhost:8080
Description: Modern dark theme with 6-column grid listing, perfect for content aggregation
Version: 1.0
Author: Claude
Text Domain: melayu
Domain Path: /languages
*/

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Warm-neutral dark palette - a faint brown/red undertone rather than flat grey */
    --primary-dark: #151312;
    --secondary-dark: #1f1c1a;
    --tertiary-dark: #2b2724;
    --accent-red: #e8505b;
    --accent-red-hover: #d13d48;
    --accent-warm: #c9a227;
    /* Text never approaches pure white - contrast is kept gentle */
    --text-light: #c7c0b8;
    --text-strong: #e3dbd1;
    --text-muted: #837a71;
    --border-color: #2f2a26;
}

body {
    background-color: var(--primary-dark);
    color: var(--text-light);
    font-family: "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Header */
header {
    background-color: var(--secondary-dark);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 3000;
}

.header-wrapper {
    max-width: 1180px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.header-right {
    flex: 1;
    justify-content: flex-end;
}

/* ---------- Category menu (beside the logo) ---------- */
.category-menu {
    position: relative;
}

/* Trigger: symbol only */
.category-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: opacity 0.18s ease;
}

.category-trigger:hover {
    opacity: 0.75;
}

.cat-symbol {
    font-size: 19px;
    line-height: 1;
    flex-shrink: 0;
}

/* Each category has its own colour */
.cat-all      { color: #ff4d8d; }
.cat-straight { color: #46b96a; }
.cat-trans    { color: #b565d8; }
.cat-gay      { color: #4a90e2; }
.cat-lesbian  { color: #f06292; }
.cat-hentai   { color: #f5a623; }
.cat-amateur  { color: #ffb74d; }

.category-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 172px;
    background: #1b1b1b;
    border: 1px solid #000;
    padding: 0;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.14s ease, visibility 0.14s;
    z-index: 1200;
}

.category-menu.is-open .category-dropdown {
    opacity: 1;
    visibility: visible;
}

.cat-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 16px;
    color: #e8e8e8;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    white-space: nowrap;
    transition: background 0.14s ease;
}

.cat-item:hover {
    background: #262626;
}

/* Active category: light background, dark text */
.cat-item.is-current {
    background: #f2f2f2;
    color: #1a1a1a;
}

.cat-item.is-current:hover {
    background: #ffffff;
}

@media (max-width: 760px) {
    .header-wrapper {
        flex-wrap: wrap;
        padding: 10px 14px;
    }

    .header-right {
        flex: 1 1 100%;
        justify-content: space-between;
    }
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-red);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

.logo span {
    font-size: 20px;
}

/* ---------- Search: the icon in the top bar ---------- */
.search-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 4px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.18s ease;
}

.search-icon-btn:hover {
    background: var(--tertiary-dark);
    border-color: var(--border-color);
    color: var(--text-strong);
}

/* ---------- Search dialog ---------- */
.search-modal {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: none;
}

.search-modal.is-open {
    display: block;
}

.search-panel {
    position: relative;
    max-width: 560px;
    margin: 9vh auto 0;
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 42px 16px 16px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
    max-height: 78vh;
    display: flex;
    flex-direction: column;
}

.search-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
}

.search-close:hover {
    color: var(--text-strong);
}

.search-field {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--primary-dark);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 0 10px;
    flex-shrink: 0;
}

.search-field:focus-within {
    border-color: var(--accent-red);
}

.search-field-icon {
    display: flex;
    color: var(--text-muted);
    flex-shrink: 0;
}

.search-field-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-strong);
    font-family: inherit;
    font-size: 15px;
    padding: 12px 10px;
    min-width: 0;
}

.search-field-input:focus {
    outline: none;
}

.search-field-input::placeholder {
    color: var(--text-muted);
}

.search-field-input::-webkit-search-cancel-button {
    display: none;
}

.search-field-clear {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
    flex-shrink: 0;
}

.search-field-clear:hover {
    color: var(--text-strong);
}

/* Result list */
.search-results {
    margin-top: 8px;
    overflow-y: auto;
    flex: 1;
}

.search-group-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 10px 6px;
    font-size: 12px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.search-clear-all {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 11.5px;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
}

.search-clear-all:hover {
    color: var(--accent-red);
}

.search-row {
    display: flex;
    align-items: center;
    border-radius: 4px;
    transition: background 0.15s ease;
}

.search-row:hover {
    background: var(--tertiary-dark);
}

.search-row-main {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    padding: 11px 10px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 14px;
}

.search-row:hover .search-row-main {
    color: var(--text-strong);
}

.row-icon {
    width: 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 15px;
    flex-shrink: 0;
}

.row-icon-tag {
    font-size: 17px;
    font-weight: 600;
}

.row-avatar {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.row-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.row-meta {
    margin-left: auto;
    font-size: 11.5px;
    color: var(--text-muted);
    background: var(--primary-dark);
    padding: 1px 7px;
    border-radius: 9px;
    flex-shrink: 0;
}

.row-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
    padding: 6px 12px;
    flex-shrink: 0;
}

.row-remove:hover {
    color: var(--accent-red);
}

.search-empty {
    padding: 26px 10px;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
}

@media (max-width: 600px) {
    .search-panel {
        margin: 0;
        max-width: none;
        height: 100%;
        max-height: none;
        border-radius: 0;
        border: none;
    }
}

/* Main container */
.container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 20px 16px 40px;
}

/* Title */
.page-title {
    font-size: 21px;
    font-weight: 500;
    margin-bottom: 18px;
    color: var(--text-light);
}

.search-title {
    color: var(--accent-red);
    margin-right: 10px;
}

/* Grid layout */
.grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin-bottom: 30px;
}

.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Card - no frame, just the cover with minimal text beneath */
.card {
    background: transparent;
    border: none;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.card:hover {
    opacity: 0.85;
}

.card-image-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 100%; /* kare kapak */
    overflow: hidden;
    border-radius: 4px;
    background-color: var(--tertiary-dark);
}

/* WordPress gives the <img> its own classes, so target the element directly */
.card-image-wrapper img,
.card-image-wrapper .card-placeholder {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.card:hover .card-image-wrapper img {
    transform: scale(1.04);
}

.card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: linear-gradient(135deg, #3a3a4a 0%, #2a2a35 100%);
    color: var(--text-muted);
}

/* Persistent badges over the cover */
.card-badges {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 6px;
    z-index: 2;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
    font-size: 12.5px;
    color: #ece5dc;
    pointer-events: none;
}

.card-views {
    display: flex;
    align-items: center;
    gap: 3px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

.card-duration {
    background: rgba(0, 0, 0, 0.65);
    padding: 1px 5px;
    border-radius: 2px;
}

/* Covers are softened slightly - bright images tire the eye on a dark ground */
.card-image-wrapper img {
    filter: brightness(0.94) saturate(0.95);
}

.card:hover .card-image-wrapper img {
    filter: brightness(1) saturate(1);
}

.card-info {
    padding: 7px 2px 2px;
}

.card-title {
    font-size: 13.5px;
    font-weight: normal;
    color: var(--text-light);
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.card:hover .card-title {
    color: var(--accent-red);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    background-color: var(--secondary-dark);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.pagination a:hover {
    background-color: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

.pagination .current {
    background-color: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

/* ---------- Single video page ---------- */
.single-container {
    max-width: 1030px;
}

.single-title {
    font-size: 18px;
    font-weight: 400;
    color: var(--text-strong);
    line-height: 1.3;
    margin-bottom: 10px;
}

/* Uploader row and icon group */
.single-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.uploader {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
}

.uploader-avatar {
    display: block;
    flex-shrink: 0;
    line-height: 0;
}

.uploader-avatar img {
    border-radius: 50%;
    display: block;
}

.uploader-name {
    color: var(--accent-red);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uploader-name:hover {
    text-decoration: underline;
}

.follow-btn {
    background: var(--accent-red);
    border: none;
    color: #fff;
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.6px;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.18s ease;
}

.follow-btn:hover:not(:disabled) {
    background: var(--accent-red-hover);
}

.follow-btn.is-following {
    background: var(--tertiary-dark);
    color: var(--text-light);
}

.follow-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

/* Statistics and action icons */
.stat-bar {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    /* override the old .action-bar look */
    padding: 0;
    border: none;
    margin: 0;
}

.stat-item,
.stat-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12px;
    padding: 5px 8px;
    border-radius: 3px;
    text-decoration: none;
    line-height: 1;
}

.stat-btn {
    cursor: pointer;
    transition: all 0.16s ease;
}

.stat-btn:hover:not(:disabled) {
    background: var(--tertiary-dark);
    color: var(--text-strong);
}

.stat-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.stat-btn.is-active {
    color: var(--accent-red);
}

.stat-btn.is-active .ic {
    fill: var(--accent-red);
    stroke: var(--accent-red);
}

/* Thin-stroke icon set */
.ic {
    width: 15px;
    height: 15px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
}

/* Player */
.player-wrapper {
    background: #000;
    overflow: hidden;
    margin-bottom: 10px;
    line-height: 0;
}

.player {
    display: block;
    width: 100%;
    max-height: 620px;
    background: #000;
}

.player-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 340px;
    font-size: 46px;
    color: var(--text-muted);
    background: var(--tertiary-dark);
    line-height: 1;
}

.erome-album-media {
    display: grid;
    gap: 14px;
    margin: 0 0 18px;
}

.erome-album-item {
    width: 100%;
    max-height: 82vh;
    background: #000;
    border: 1px solid var(--border-color);
    display: block;
}

.erome-album-video {
    aspect-ratio: 16 / 9;
}

.erome-album-image {
    height: auto;
    object-fit: contain;
}

/* Tags */
.single-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-bottom: 18px;
}

.hash-tag {
    color: var(--accent-red);
    text-decoration: none;
    font-size: 12px;
}

.hash-tag:hover {
    text-decoration: underline;
}

.single-content {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-light);
    margin-bottom: 20px;
}

/* Section headings */
.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-strong);
    margin-bottom: 12px;
}

.section-title .ic {
    width: 16px;
    height: 16px;
    color: var(--text-muted);
}

/* ---------- Comments ---------- */
.comments-section {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
}

.comment-count {
    font-size: 12px;
    color: var(--text-muted);
    background: var(--tertiary-dark);
    padding: 1px 7px;
    border-radius: 9px;
}

.comment-list {
    list-style: none;
    margin: 0 0 14px;
    padding: 0;
}

.comment-list .children {
    list-style: none;
    margin: 6px 0 0 34px;
    padding: 0;
}

.comment-row {
    display: flex;
    gap: 9px;
    padding: 7px 0;
}

.comment-avatar img {
    border-radius: 50%;
    display: block;
}

.comment-body {
    min-width: 0;
    flex: 1;
}

.comment-line {
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-light);
}

.comment-author {
    color: var(--accent-red);
    font-weight: 600;
    margin-right: 6px;
}

.comment-text p {
    display: inline;
    margin: 0;
}

.comment-meta {
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 3px;
}

.comment-meta a {
    color: var(--text-muted);
    text-decoration: none;
}

.comment-meta a:hover {
    color: var(--accent-red);
}

/* Comment form */
.comment-form-wrap,
.comment-respond {
    margin-top: 10px;
}

.comment-form {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.comment-form p {
    margin: 0;
}

.comment-form .comment-form-comment {
    flex: 1;
    min-width: 0;
}

.comment-input {
    width: 100%;
    background: transparent;
    border: 1px dashed var(--border-color);
    border-radius: 3px;
    color: var(--text-light);
    font-family: inherit;
    font-size: 13px;
    padding: 9px 11px;
    resize: vertical;
    min-height: 38px;
}

.comment-input:focus {
    outline: none;
    border-style: solid;
    border-color: var(--accent-red);
}

.comment-input::placeholder {
    color: var(--text-muted);
}

.comment-submit {
    flex-shrink: 0;
    padding: 9px 16px;
    font-size: 13px;
}

.comment-form .form-submit {
    margin: 0;
}

.comment-login,
.comment-closed {
    font-size: 13px;
    color: var(--text-muted);
    padding: 10px 0;
}

.comment-login a {
    color: var(--accent-red);
    text-decoration: none;
}

.logged-in-as,
.comment-notes {
    display: none;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
}

/* More videos */
.related-section {
    margin-top: 30px;
    padding-top: 18px;
    border-top: 1px solid var(--border-color);
}

.single-container .grid {
    grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 1024px) {
    .single-container .grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .single-container .grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .single-topbar {
        align-items: flex-start;
    }

    .stat-bar {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .single-container .grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Related searches */
.related-searches {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

.related-title {
    font-size: 16px;
    margin-bottom: 15px;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 8px;
}

.related-title::before {
    content: "🔍";
    font-size: 14px;
}

.related-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.related-tag {
    padding: 6px 12px;
    background-color: var(--secondary-dark);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    text-decoration: none;
    border-radius: 20px;
    font-size: 12px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.related-tag:hover {
    background-color: var(--accent-red);
    border-color: var(--accent-red);
    color: white;
}

/* Responsive */
@media (max-width: 1024px) {
    .grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .header-wrapper {
        flex-direction: column;
        gap: 15px;
    }

    .search-container {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .page-title {
        font-size: 18px;
    }
}

/* ---------- Generic buttons ---------- */
.btn-primary,
.btn-ghost {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    font-family: inherit;
    transition: all 0.2s ease;
}

.btn-primary {
    background: var(--accent-red);
    color: #fff;
}

.btn-primary:hover {
    background: var(--accent-red-hover);
}

.btn-ghost {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-light);
}

.btn-ghost:hover {
    border-color: var(--text-muted);
    color: var(--text-strong);
}

/* ---------- Header navigation ---------- */
.header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    position: relative;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    padding: 6px 10px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.nav-link:hover {
    color: var(--text-strong);
}

.nav-link-accent {
    color: var(--accent-red);
}

/* User menu */
.user-menu {
    position: relative;
}

.user-menu-trigger {
    display: flex;
    align-items: center;
    gap: 7px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-light);
    font-family: inherit;
    font-size: 13px;
    padding: 5px 9px;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-menu-trigger:hover,
.user-menu.is-open .user-menu-trigger {
    background: var(--tertiary-dark);
    border-color: var(--border-color);
    color: var(--text-strong);
}

.user-avatar {
    border-radius: 50%;
    display: block;
}

.caret {
    font-size: 10px;
    opacity: 0.7;
}

.user-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    max-width: min(280px, calc(100vw - 24px));
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 5px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
    z-index: 4000;
}

.user-menu.is-open .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}


.dropdown-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    color: var(--text-light);
    text-decoration: none;
    font-size: 13px;
    border-radius: 4px;
    transition: background 0.15s ease, color 0.15s ease;
}

.dropdown-item:hover {
    background: var(--tertiary-dark);
    color: var(--text-strong);
}

.dropdown-icon {
    width: 16px;
    text-align: center;
    opacity: 0.85;
}

.dropdown-count {
    margin-left: auto;
    font-size: 11px;
    color: var(--text-muted);
    background: var(--tertiary-dark);
    padding: 1px 6px;
    border-radius: 9px;
}

.dropdown-sep {
    height: 1px;
    background: var(--border-color);
    margin: 5px 0;
}

/* ---------- Action bar below the video ---------- */
.action-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 14px 0 18px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.action-btn.is-active {
    background: rgba(232, 80, 91, 0.14);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.btn-count {
    font-variant-numeric: tabular-nums;
}

/* ---------- User page tabs ---------- */
.user-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.user-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 13px;
    border-radius: 18px;
    font-size: 13px;
    color: var(--text-light);
    text-decoration: none;
    border: 1px solid var(--border-color);
    background: var(--secondary-dark);
    transition: all 0.18s ease;
}

.user-tab:hover {
    border-color: var(--text-muted);
    color: var(--text-strong);
}

.user-tab.is-active {
    background: rgba(232, 80, 91, 0.14);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

.tab-count {
    font-size: 11px;
    opacity: 0.75;
}

/* ---------- Notice box ---------- */
.notice-box {
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 26px;
    text-align: center;
}

.notice-box p {
    color: var(--text-light);
    margin-bottom: 16px;
}

.notice-box a {
    margin: 0 4px;
}

/* ---------- Report dialog ---------- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: none;
}

.modal.is-open {
    display: block;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
}

.modal-box {
    position: relative;
    max-width: 440px;
    margin: 12vh auto 0;
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-head h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-strong);
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
}

.modal-close:hover {
    color: var(--text-strong);
}

.field-label {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 5px;
}

.field-input {
    width: 100%;
    background: var(--tertiary-dark);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    border-radius: 4px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    margin-bottom: 14px;
}

.field-input:focus {
    outline: none;
    border-color: var(--accent-red);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ---------- Author profile page ---------- */
.profile-container {
    max-width: 1180px;
}

.profile-head {
    text-align: center;
    padding: 22px 0 26px;
}

.profile-avatar {
    margin-bottom: 14px;
    line-height: 0;
}

.profile-avatar img {
    width: 110px;
    height: 110px;
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
    border: 2px solid var(--border-color);
}

.profile-name {
    font-size: 26px;
    font-weight: 500;
    color: var(--accent-red);
    margin-bottom: 14px;
}

.profile-actions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-bottom: 16px;
}

.profile-follow {
    font-size: 12px;
    padding: 8px 15px;
}

.profile-edit {
    padding: 7px 14px;
    font-size: 12.5px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--tertiary-dark);
    border: 1px solid var(--border-color);
    border-radius: 3px;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    transition: all 0.18s ease;
}

.icon-btn:hover:not(:disabled) {
    border-color: var(--text-muted);
    color: var(--text-strong);
}

.icon-btn:disabled {
    opacity: 0.55;
    cursor: default;
}

.icon-btn.is-active {
    background: rgba(232, 80, 91, 0.15);
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* Three-dot menu */
.more-menu {
    position: relative;
}

.more-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 190px;
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 5px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-4px);
    transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
    z-index: 1200;
    text-align: left;
}

.more-menu.is-open .more-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.more-dropdown .dropdown-item {
    width: 100%;
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 12.5px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    cursor: pointer;
    text-align: left;
}

.more-dropdown .dropdown-icon .ic {
    width: 14px;
    height: 14px;
}

/* Statistics row */
.profile-stats {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-bottom: 12px;
    font-size: 12px;
    letter-spacing: 0.5px;
    color: var(--text-muted);
}

.profile-stats .stat strong {
    color: var(--text-light);
    font-weight: 600;
    margin-right: 3px;
}

.profile-bio {
    max-width: 560px;
    margin: 0 auto;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-light);
}

.profile-location {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 4px;
}

/* Tab row */
.profile-tabs {
    display: flex;
    align-items: center;
    gap: 16px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 18px;
    padding-bottom: 0;
}

.profile-tab {
    display: inline-block;
    padding: 9px 2px;
    font-size: 13px;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
}

.profile-tab.is-active {
    color: var(--accent-red);
    border-bottom-color: var(--accent-red);
}

.profile-tab-count {
    font-size: 12px;
    color: var(--text-muted);
    letter-spacing: 0.4px;
}

@media (max-width: 600px) {
    .profile-stats {
        gap: 12px;
        font-size: 11px;
    }

    .profile-name {
        font-size: 21px;
    }

    .profile-avatar img {
        width: 88px;
        height: 88px;
    }
}

.stat-link {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.16s ease;
}

.stat-link:hover {
    color: var(--accent-red);
}

.crumb-link {
    color: var(--accent-red);
    text-decoration: none;
}

.crumb-sep {
    color: var(--text-muted);
    margin: 0 4px;
}

/* ---------- 404 ---------- */
.error-page {
    text-align: center;
    padding: 46px 20px 38px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 26px;
}

.error-code {
    font-size: 74px;
    font-weight: 700;
    line-height: 1;
    color: var(--accent-red);
    opacity: 0.85;
    letter-spacing: 2px;
}

.error-title {
    font-size: 21px;
    font-weight: 500;
    color: var(--text-strong);
    margin: 14px 0 8px;
}

.error-text {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 22px;
}

.error-actions {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 26px;
}

.error-categories {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.error-categories-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-right: 2px;
}

@media (max-width: 600px) {
    .error-code {
        font-size: 56px;
    }

    .error-page {
        padding: 32px 12px 28px;
    }
}

/* ---------- Suggested users strip ---------- */
.suggested-users {
    margin-top: 34px;
    padding-top: 22px;
    border-top: 1px solid var(--border-color);
}

.suggested-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.suggested-user {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    width: 92px;
    text-decoration: none;
    text-align: center;
}

.suggested-avatar {
    display: block;
    line-height: 0;
}

.suggested-avatar img {
    width: 78px;
    height: 78px;
    border-radius: 50%;
    object-fit: cover;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.suggested-user:hover .suggested-avatar img {
    transform: scale(1.05);
    box-shadow: 0 0 0 2px var(--accent-red);
}

.suggested-name {
    font-size: 12px;
    color: var(--accent-red);
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---------- Footer ---------- */
.site-footer {
    border-top: 1px solid var(--border-color);
    margin-top: 46px;
    padding: 26px 20px 34px;
    background: var(--primary-dark);
}

.footer-inner {
    max-width: 1180px;
    margin: 0 auto;
    text-align: center;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 0;
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12.5px;
    padding: 0 11px;
    border-right: 1px solid var(--border-color);
    line-height: 1.2;
}

.footer-links a:last-child {
    border-right: none;
}

.footer-links a:hover {
    color: var(--accent-red);
}

.footer-note {
    font-size: 11.5px;
    color: var(--text-muted);
}

.footer-sep {
    margin: 0 6px;
    opacity: 0.6;
}

/* ---------- Back to top ---------- */
.scroll-top {
    position: fixed;
    right: 20px;
    bottom: 24px;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-light);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s, border-color 0.2s ease;
    z-index: 1500;
}

.scroll-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top:hover {
    border-color: var(--accent-red);
    color: var(--accent-red);
}

/* ---------- Information pages ---------- */
.doc-container {
    max-width: 780px;
}

.doc-title {
    font-size: 26px;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 6px;
}

.doc-updated {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.doc-body {
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--text-light);
}

.doc-body h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-strong);
    margin: 30px 0 12px;
}

.doc-body h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-strong);
    margin: 22px 0 8px;
}

.doc-body p {
    margin-bottom: 14px;
}

.doc-body ul,
.doc-body ol {
    margin: 0 0 16px 22px;
}

.doc-body li {
    margin-bottom: 7px;
}

.doc-body a {
    color: var(--accent-red);
}

.doc-body strong {
    color: var(--text-strong);
}

/* ---------- Explore ---------- */
.explore-block {
    margin-bottom: 34px;
}

.explore-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
    gap: 10px;
}

.explore-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    text-decoration: none;
    color: var(--text-light);
    transition: border-color 0.18s ease;
}

.explore-card:hover {
    border-color: var(--accent-red);
    color: var(--text-strong);
}

.explore-card-name {
    flex: 1;
    font-size: 13.5px;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.explore-card-count {
    font-size: 11.5px;
    color: var(--text-muted);
}

/* Feedback form */
.feedback-form {
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    margin-top: 18px;
}

.feedback-form .form-actions {
    justify-content: flex-start;
}

@media (max-width: 600px) {
    .suggested-user {
        width: 74px;
    }

    .suggested-avatar img {
        width: 62px;
        height: 62px;
    }

    .scroll-top {
        right: 12px;
        bottom: 16px;
    }
}

/* ---------- Upload button in the top bar ---------- */
.upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--accent-red);
    color: #fff;
    text-decoration: none;
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 7px 12px;
    border-radius: 4px;
    white-space: nowrap;
    transition: background 0.18s ease;
}

.upload-btn:hover {
    background: var(--accent-red-hover);
}

.upload-btn .ic {
    width: 14px;
    height: 14px;
    stroke-width: 2.2;
}

/* ---------- Upload area ---------- */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 6px;
    padding: 34px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
}

.dropzone:hover,
.dropzone.is-dragging {
    border-color: var(--accent-red);
    background: rgba(232, 80, 91, 0.05);
}

.dropzone.has-file {
    padding: 18px 20px;
    border-style: solid;
}

.dropzone-icon .ic {
    width: 30px;
    height: 30px;
    color: var(--text-muted);
    stroke-width: 1.6;
}

.dropzone-title {
    font-size: 14px;
    color: var(--text-strong);
    margin: 10px 0 5px;
}

.dropzone-hint {
    font-size: 12px;
    color: var(--text-muted);
}

.dropzone-file {
    display: flex;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.file-name {
    flex: 1;
    min-width: 0;
    color: var(--text-strong);
    font-size: 13.5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-size {
    color: var(--text-muted);
    font-size: 12px;
    flex-shrink: 0;
}

.file-remove {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
}

.file-remove:hover {
    color: var(--accent-red);
}

/* Progress */
.upload-progress {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}

.progress-track {
    flex: 1;
    height: 6px;
    background: var(--tertiary-dark);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    width: 0;
    background: var(--accent-red);
    transition: width 0.25s ease;
}

.progress-label {
    font-size: 12px;
    color: var(--text-muted);
    min-width: 38px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* Declaration box */
.consent-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-light);
    cursor: pointer;
}

.consent-row input {
    margin-top: 3px;
    flex-shrink: 0;
}

.consent-note {
    margin-top: 12px;
    margin-bottom: 0;
}

/* ---------- Upload access box ---------- */
.upload-access .access-intro {
    margin-top: -8px;
    margin-bottom: 14px;
}

.access-state {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    border-radius: 5px;
    border: 1px solid var(--border-color);
    margin-bottom: 14px;
}

.access-state p {
    font-size: 13px;
    color: var(--text-light);
    margin: 0;
}

.access-badge {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.4px;
    padding: 3px 9px;
    border-radius: 10px;
    flex-shrink: 0;
    text-transform: uppercase;
}

.access-state.is-approved {
    background: rgba(127, 201, 143, 0.08);
    border-color: rgba(127, 201, 143, 0.35);
}

.access-state.is-approved .access-badge {
    background: rgba(127, 201, 143, 0.18);
    color: #7fc98f;
}

.access-state.is-pending {
    background: rgba(224, 176, 98, 0.08);
    border-color: rgba(224, 176, 98, 0.35);
}

.access-state.is-pending .access-badge {
    background: rgba(224, 176, 98, 0.18);
    color: #e0b062;
}

.access-state.is-rejected {
    background: rgba(232, 80, 91, 0.08);
    border-color: rgba(232, 80, 91, 0.32);
}

.access-state.is-rejected .access-badge {
    background: rgba(232, 80, 91, 0.16);
    color: var(--accent-red);
}

.access-form {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

.access-form .form-actions {
    justify-content: flex-start;
}

.access-form .form-actions .btn-ghost {
    margin-left: 0;
}

.label-optional {
    color: var(--text-muted);
    font-weight: normal;
}

/* ---------- My uploads list ---------- */
.upload-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.upload-row {
    display: flex;
    gap: 13px;
    padding: 11px 0;
    border-bottom: 1px solid var(--border-color);
}

.upload-thumb {
    width: 118px;
    flex-shrink: 0;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    overflow: hidden;
    background: var(--tertiary-dark);
    position: relative;
}

.upload-thumb img,
.upload-thumb .card-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: static;
}

.upload-info {
    flex: 1;
    min-width: 0;
}

.upload-title {
    display: block;
    color: var(--text-strong);
    font-size: 14px;
    text-decoration: none;
    margin-bottom: 6px;
}

a.upload-title:hover {
    color: var(--accent-red);
}

.upload-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    font-size: 11.5px;
    color: var(--text-muted);
}

.status-badge {
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    border: 1px solid;
}

.status-publish {
    color: #7fc98f;
    border-color: rgba(127, 201, 143, 0.4);
    background: rgba(127, 201, 143, 0.1);
}

.status-pending {
    color: #e0b062;
    border-color: rgba(224, 176, 98, 0.4);
    background: rgba(224, 176, 98, 0.1);
}

.status-draft {
    color: var(--text-muted);
    border-color: var(--border-color);
}

.status-processing {
    color: #7aa7d9;
    border-color: rgba(122, 167, 217, 0.4);
    background: rgba(122, 167, 217, 0.1);
}

@media (max-width: 600px) {
    .upload-btn-label {
        display: none;
    }

    .upload-thumb {
        width: 88px;
    }
}

/* ---------- User card list (followers / conversations) ---------- */
.user-card-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 12px;
    border-radius: 5px;
    border: 1px solid transparent;
    transition: background 0.15s ease;
}

.user-card:hover {
    background: var(--secondary-dark);
}

.user-card-avatar {
    flex-shrink: 0;
    line-height: 0;
}

.user-card-avatar img {
    border-radius: 50%;
    display: block;
}

.user-card-body {
    flex: 1;
    min-width: 0;
    display: block;
    text-decoration: none;
}

.user-card-name {
    display: block;
    color: var(--text-strong);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

a.user-card-name:hover {
    color: var(--accent-red);
}

.user-card-meta {
    display: block;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Conversation row */
.conversation.is-unread .user-card-name {
    color: var(--accent-red);
}

.conversation.is-unread .conversation-preview {
    color: var(--text-light);
}

.preview-you {
    color: var(--text-muted);
    margin-right: 3px;
}

.conversation-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    flex-shrink: 0;
}

.conversation-time {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
}

.unread-badge,
.dropdown-count.is-alert {
    background: var(--accent-red);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    padding: 1px 6px;
    border-radius: 9px;
}

/* ---------- Chat view ---------- */
.chat-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 14px;
}

.chat-back {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 20px;
    line-height: 1;
    padding: 2px 6px;
}

.chat-back:hover {
    color: var(--text-strong);
}

.chat-peer {
    display: flex;
    align-items: center;
    gap: 9px;
    text-decoration: none;
    min-width: 0;
}

.chat-peer img {
    border-radius: 50%;
    display: block;
    flex-shrink: 0;
}

.chat-peer-name {
    color: var(--text-strong);
    font-size: 15px;
    font-weight: 500;
}

.chat-peer:hover .chat-peer-name {
    color: var(--accent-red);
}

.chat-window {
    height: 52vh;
    min-height: 300px;
    overflow-y: auto;
    padding: 6px 4px;
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-bottom: 12px;
}

.chat-empty {
    margin: auto;
    color: var(--text-muted);
    font-size: 13px;
    text-align: center;
}

.chat-bubble {
    align-self: flex-start;
    max-width: 76%;
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 12px 12px 12px 3px;
    padding: 8px 12px;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--text-light);
    word-break: break-word;
}

.chat-bubble.is-mine {
    align-self: flex-end;
    background: rgba(232, 80, 91, 0.16);
    border-color: rgba(232, 80, 91, 0.4);
    border-radius: 12px 12px 3px 12px;
    color: var(--text-strong);
}

.bubble-text {
    display: block;
    white-space: pre-wrap;
}

.bubble-time {
    display: block;
    font-size: 10.5px;
    color: var(--text-muted);
    margin-top: 3px;
    text-align: right;
}

.chat-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}

.chat-input {
    flex: 1;
    min-width: 0;
    background: var(--tertiary-dark);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    color: var(--text-light);
    font-family: inherit;
    font-size: 13.5px;
    padding: 10px 12px;
    resize: none;
    line-height: 1.4;
    max-height: 140px;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent-red);
}

.chat-send {
    flex-shrink: 0;
    padding: 10px 18px;
}

.chat-send:disabled {
    opacity: 0.6;
    cursor: default;
}

/* ---------- Account settings page ---------- */
.account-container {
    max-width: 700px;
}

.account-form {
    margin-top: 4px;
}

.form-section {
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    margin-bottom: 16px;
}

.form-section-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-strong);
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.form-section-hint {
    margin-top: -8px;
    margin-bottom: 16px;
}

.field-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    margin: -10px 0 14px;
}

.field-input:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--text-light);
    cursor: pointer;
}

.avatar-row {
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.avatar-preview img {
    border-radius: 50%;
    display: block;
    border: 2px solid var(--border-color);
}

.avatar-controls {
    flex: 1;
    min-width: 0;
}

.form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 4px;
}

.form-actions .btn-ghost {
    margin-left: auto;
}

/* Two-column field layout */
.field-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 14px;
}

@media (max-width: 520px) {
    .field-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Searchable select ---------- */
.searchable-select {
    position: relative;
    margin-bottom: 14px;
}

.searchable-select .select-search {
    margin-bottom: 0;
    padding-right: 30px;
}

.select-clear {
    position: absolute;
    right: 8px;
    top: 7px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 17px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 5px;
}

.select-clear:hover {
    color: var(--text-strong);
}

.select-options {
    position: absolute;
    top: calc(100% + 3px);
    left: 0;
    right: 0;
    max-height: 240px;
    overflow-y: auto;
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    list-style: none;
    padding: 4px;
    margin: 0;
    z-index: 900;
    display: none;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.5);
}

.searchable-select.is-open .select-options {
    display: block;
}

.select-option {
    padding: 7px 10px;
    font-size: 13px;
    color: var(--text-light);
    border-radius: 3px;
    cursor: pointer;
}

.select-option:hover {
    background: var(--tertiary-dark);
    color: var(--text-strong);
}

.select-option.is-selected {
    color: var(--accent-red);
}

.select-empty {
    padding: 10px;
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    list-style: none;
}

/* Scrollbar */
.select-options::-webkit-scrollbar {
    width: 9px;
}

.select-options::-webkit-scrollbar-track {
    background: var(--primary-dark);
}

.select-options::-webkit-scrollbar-thumb {
    background: var(--tertiary-dark);
    border-radius: 5px;
}

/* Alert strips */
.alert {
    padding: 11px 14px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 12px;
    border: 1px solid;
}

.alert-error {
    background: rgba(232, 80, 91, 0.1);
    border-color: rgba(232, 80, 91, 0.4);
    color: #f0a0a6;
}

.alert-success {
    background: rgba(90, 170, 110, 0.1);
    border-color: rgba(90, 170, 110, 0.4);
    color: #9ad3aa;
}

/* ---------- Toast ---------- */
.melayu-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 12px);
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    color: var(--text-strong);
    padding: 11px 20px;
    border-radius: 22px;
    font-size: 13px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    z-index: 3000;
}

.melayu-toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
}

@media (max-width: 600px) {
    .user-name {
        display: none;
    }

    .action-btn .btn-label {
        display: none;
    }

    .action-btn-muted {
        margin-left: 0;
    }
}

/* Empty state */
.no-posts {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.no-posts p {
    font-size: 16px;
}

/* -------------------------------------------------------------
 *  Account flow: sign in, sign up, reset, verification, deletion
 * ----------------------------------------------------------- */

.auth-container {
    max-width: 460px;
    padding-top: 40px;
    padding-bottom: 60px;
}

.auth-card {
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 28px 26px 30px;
}

.auth-title {
    margin: 0 0 18px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-strong);
}

.auth-note {
    margin: 0 0 18px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-light);
}

.auth-form .field-input { width: 100%; }

.btn-block { width: 100%; }

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 12px 0 0;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-light);
    cursor: pointer;
}

.checkbox-row input { margin-top: 3px; }
.checkbox-row a { color: var(--accent-red); }

.auth-links {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    font-size: 13px;
}

.auth-links a { color: var(--text-muted); }
.auth-links a:hover { color: var(--accent-red); }

.form-error,
.form-notice {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 5px;
    font-size: 13px;
    line-height: 1.5;
}

.form-error {
    background: rgba(232, 80, 91, 0.12);
    border: 1px solid rgba(232, 80, 91, 0.4);
    color: #f0a2a8;
}

.form-notice {
    background: rgba(201, 162, 39, 0.12);
    border: 1px solid rgba(201, 162, 39, 0.35);
    color: #ddc271;
}

/* The honeypot must be reachable by nothing but a bot */
.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* --- Verification banner on the account page --- */

.alert-warning {
    background: rgba(201, 162, 39, 0.1);
    border: 1px solid rgba(201, 162, 39, 0.35);
    color: #ddc271;
}

.verify-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 14px 16px;
    border-radius: 6px;
    margin-bottom: 18px;
}

.verify-text { display: flex; flex-direction: column; gap: 3px; }
.verify-text strong { font-size: 14px; }
.verify-text span { font-size: 13px; color: var(--text-light); }
.verify-form { margin: 0; }

.btn-small {
    padding: 7px 13px;
    font-size: 13px;
}

/* --- Deletion --- */

.danger-zone {
    border: 1px solid rgba(232, 80, 91, 0.35);
    border-radius: 6px;
    padding: 20px 18px;
    margin-top: 34px;
}

.danger-zone .form-section-title { color: var(--accent-red); }
.delete-form { margin-top: 14px; }

.btn-danger {
    background: transparent;
    border: 1px solid var(--accent-red);
    color: var(--accent-red);
    padding: 9px 16px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    transition: background .15s, color .15s;
}

.btn-danger:hover {
    background: var(--accent-red);
    color: #fff;
}

.site-notice {
    margin: 16px 0;
    padding: 11px 14px;
    background: var(--tertiary-dark);
    border-left: 3px solid var(--accent-warm);
    border-radius: 4px;
    font-size: 14px;
    color: var(--text-light);
}

@media (max-width: 560px) {
    .auth-container { padding-top: 22px; }
    .auth-card { padding: 20px 16px 24px; }
    .auth-links { flex-direction: column; gap: 8px; }
    .verify-banner { flex-direction: column; align-items: stretch; }
}

/* -------------------------------------------------------------
 *  Header icon row (signed in)
 * ----------------------------------------------------------- */

.header-icons {
    display: flex;
    align-items: center;
    gap: 4px;
    position: relative;
    z-index: 4100;
}

.header-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    transition: color .15s, background .15s;
}

.header-icon:hover,
.header-icon:focus-visible {
    color: var(--text-strong);
    background: var(--tertiary-dark);
    outline: none;
}

.header-icon .ic-line {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.header-icon.has-alert { color: var(--accent-red); }

.header-icon .user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: block;
}

/* Unread count on the messages icon */
.icon-badge {
    position: absolute;
    top: 1px;
    right: 0;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: 8px;
    background: var(--accent-red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 15px;
    text-align: center;
}

/* The dropdown now hangs off an avatar button rather than a name */
.header-icons .user-menu {
    position: relative;
    z-index: 4200;
}

.profile-container,
.profile-head {
    position: relative;
    z-index: 1;
}

.dropdown-head {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 14px 9px;
}

.dropdown-head .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.dropdown-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-strong);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 560px) {
    .header-icons { gap: 0; }
    .header-icon { width: 30px; height: 30px; }
    .header-icon .ic-line { width: 17px; height: 17px; }
}

/* -------------------------------------------------------------
 *  Notifications list
 * ----------------------------------------------------------- */

.notif-list {
    list-style: none;
    margin: 18px 0 0;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}

.notif-row + .notif-row { border-top: 1px solid var(--border-color); }

.notif-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: var(--secondary-dark);
    color: var(--text-light);
    text-decoration: none;
    transition: background .15s;
}

.notif-link:hover { background: var(--tertiary-dark); }

/* Unread rows carry a warm edge rather than a different background */
.notif-row.is-unread .notif-link {
    box-shadow: inset 3px 0 0 var(--accent-red);
}

.notif-avatar img {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: block;
}

.notif-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--tertiary-dark);
    font-size: 15px;
}

.notif-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.notif-text {
    font-size: 14px;
    color: var(--text-strong);
}

.notif-row.is-unread .notif-text { font-weight: 600; }

.notif-time {
    font-size: 12px;
    color: var(--text-muted);
}

.notif-mark {
    font-size: 14px;
    opacity: .5;
}

@media (max-width: 560px) {
    .notif-mark { display: none; }
    .notif-link { padding: 11px 12px; gap: 10px; }
}

/* -------------------------------------------------------------
 *  18+ entry screen
 * ----------------------------------------------------------- */

/* Set by the gate's own script; without JS the overlay still covers the page */
html.age-locked,
html.age-locked body {
    overflow: hidden;
}

.age-gate {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(10, 9, 8, .96);
}

.age-gate-panel {
    width: 100%;
    max-width: 460px;
    padding: 30px 28px 24px;
    background: var(--secondary-dark);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
}

.age-gate-title {
    margin: 0 0 14px;
    font-size: 20px;
    font-weight: 600;
    color: var(--text-strong);
}

.age-gate-text {
    margin: 0 0 22px;
    font-size: 14px;
    line-height: 1.65;
    color: var(--text-light);
}

.age-gate-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0 0 18px;
}

.age-gate-actions .btn-primary,
.age-gate-actions .btn-ghost {
    width: 100%;
    padding: 11px 16px;
    font-size: 14px;
    text-align: center;
}

.age-gate-links {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin: 0 0 12px;
    font-size: 13px;
}

.age-gate-links a { color: var(--text-muted); }
.age-gate-links a:hover { color: var(--accent-red); }

.age-gate-note {
    margin: 0;
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-muted);
}

@media (max-width: 480px) {
    .age-gate-panel { padding: 24px 18px 20px; }
    .age-gate-title { font-size: 18px; }
}

/* -------------------------------------------------------------
 *  Narrow screens: keep absolutely-positioned panels on the page
 *
 *  The category dropdown and the user dropdown are anchored to their
 *  triggers, which sit near the right edge. At 375px their fixed min-width
 *  pushed the document to 406px - and a visibility:hidden panel still
 *  widens the document, so the whole site scrolled sideways before either
 *  menu was ever opened.
 * ----------------------------------------------------------- */

@media (max-width: 600px) {

    .category-dropdown,
    .user-dropdown {
        position: fixed;
        top: 52px;
        left: 8px;
        right: 8px;
        width: auto;
        min-width: 0;
        max-height: calc(100vh - 68px);
        overflow-y: auto;
    }

    .scroll-top {
        right: 12px;
        bottom: 16px;
    }
}
