:root {
--bg: #08060f;
--bg2: #0d0917;
--card: #110c1b;
--card2: #151021;
--border: #2a1d3d;
--border2: #3b2856;
--purple: #8b5cf6;
--purple2: #a78bfa;
--text: #f5f1ff;
--muted: #91879e;
--muted2: #6e647b;
--danger: #e05278;
}

{
box-sizing: border-box;
}
body {
margin: 0;
background:
radial-gradient(
circle at 80% 0%,
rgba(124,58,237,.10),
transparent 30%
),
var(--bg);
color: var(--text);
font-family:
Arial,
Helvetica,
sans-serif;
}

body,
button,
input,
textarea,
select {
font-family:
Arial,
Helvetica,
sans-serif;
}

a {
text-decoration: none;
color: inherit;
}

button {
cursor: pointer;
}

.container {
width: 92%;
max-width: 1180px;
margin: auto;
}

/* HEADER */

.header {
position: sticky;
top: 0;
z-index: 100;

background: rgba(8,6,15,.94);

border-bottom:
    1px solid var(--border);

backdrop-filter: blur(14px);

}

.nav-wrap {
width: 92%;
max-width: 1280px;

min-height: 70px;

margin: auto;

display: flex;
align-items: center;

gap: 24px;

}

.logo {
font-size: 20px;
font-weight: 800;

color: white;

white-space: nowrap;

display: inline-flex;
align-items: center;
line-height: 1;
}

.logo img {
    display: block;
    width: 230px !important;
    height: auto !important;
    max-width: 230px !important;
    max-height: 78px !important;
    object-fit: contain;
}


.main-nav {
    align-items: center;
}

.main-nav a {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.main-nav {
flex: 1;
display: flex;
justify-content: center;
align-items: center;
gap: 20px;
}

.main-nav a {
color: var(--muted);

font-size: 12px;

transition: .2s;

}

.main-nav a:hover {
color: var(--purple2);
}

.header-actions {
display: flex;
gap: 7px;
}

.support-btn,
.admin-btn {
display: inline-flex;

align-items: center;
justify-content: center;

border:
    1px solid var(--border2);

background: #120d1c;

color: #bda9db;

padding: 8px 12px;

border-radius: 6px;

font-size: 11px;

}

.support-btn:hover,
.admin-btn:hover {
color: white;

border-color: var(--purple);

background: #191126;

}


.header-socials {
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.header-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 9px;
    border: 1px solid var(--border2);
    border-radius: 6px;
    background: #120d1c;
    color: #bda9db;
    font-size: 11px;
    font-weight: 600;
}

.header-socials a:hover {
    color: white;
    border-color: var(--purple);
    background: #191126;
}

@media (max-width: 1100px) {
    .header-socials {
        gap: 5px;
    }
    .header-socials a {
        padding: 7px 7px;
        font-size: 10px;
    }
}

/* HERO */

.hero {
min-height: 440px;

display: flex;
align-items: center;

border-bottom:
    1px solid #1c1428;

background:
    radial-gradient(
        circle at 75% 50%,
        rgba(139,92,246,.20),
        transparent 35%
    );

}

.hero-inner {
width: 92%;
max-width: 1180px;
margin: auto;
}

.eyebrow {
margin: 0 0 10px;

color: var(--purple2);

font-size: 10px;

font-weight: 800;

letter-spacing: 3px;

}

.hero h1 {
margin: 0;

font-size:
    clamp(42px, 7vw, 76px);

line-height: 1.02;

letter-spacing: -2px;

}

.hero h1 span {
color: var(--purple2);
}

.hero-text {
max-width: 600px;

margin: 22px 0;

color: var(--muted);

line-height: 1.7;

}

.hero-btn {
display: inline-block;

padding: 12px 18px;

border-radius: 6px;

background: var(--purple);

font-size: 12px;

font-weight: 700;

}

.hero-btn:hover {
background: #9b6bff;
}

/* SEARCH */

.search-area {
padding: 25px 0 5px;
}

#searchInput {
width: 100%;

height: 48px;

padding: 0 15px;

background: #100b18;

border:
    1px solid var(--border);

border-radius: 7px;

color: white;

outline: none;

}

#searchInput:focus {
border-color: var(--purple);
}

/* CATALOG */

.catalog {
padding-top: 28px;
padding-bottom: 90px;
}

.section-head {
display: flex;

justify-content: space-between;

align-items: end;

margin-bottom: 20px;

}

.section-head h2 {
margin: 0;

font-size: 27px;

}

.content-count {
color: var(--muted2);

font-size: 11px;

}

/* CARDS */

.content-grid {
display: grid;

grid-template-columns:
    repeat(auto-fit, minmax(320px, 320px));
justify-content: center;

gap: 17px;

}

.content-card {
overflow: hidden;
cursor: default;

border:
    1px solid var(--border);

background: var(--card);

border-radius: 8px;

transition: .2s;

}

.content-card:hover {
transform: translateY(-4px);

border-color: #60428d;

box-shadow:
    0 15px 35px rgba(0,0,0,.3);

}

.poster {
position: relative;

width: 320px;
height: 320px;
max-width: none;

background: #171020;

overflow: hidden;

}

.poster img {
width: 100%;
height: 100%;

display: block;

object-fit: contain;
object-position: center;

}

.poster-placeholder {
width: 100%;
height: 100%;

display: flex;

align-items: center;
justify-content: center;

padding: 15px;

text-align: center;

color: #8c769f;

background:
    linear-gradient(
        135deg,
        #181022,
        #0d0915
    );

font-weight: 700;

}

.arno-badge {
position: absolute;

top: 9px;
left: 9px;

padding: 5px 7px;

border-radius: 4px;

background:
    rgba(124,58,237,.9);

color: white;

font-size: 8px;

font-weight: 700;

}

.card-body {
padding: 12px;
}

.card-title-row {
display: flex;
align-items: flex-start;
gap: 7px;
margin-bottom: 6px;
}

.card-title {
margin-bottom: 0;
min-width: 0;
flex: 1;

font-size: 13px;

font-weight: 700;

white-space: nowrap;

overflow: hidden;

text-overflow: ellipsis;

}

.latest-badge {
flex: 0 0 auto;
padding: 3px 6px;
border-radius: 4px;
font-size: 8px;
font-weight: 800;
line-height: 1;
text-transform: uppercase;
letter-spacing: .2px;
}

.latest-badge.baru {
background: rgba(34,197,94,.16);
color: #86efac;
border: 1px solid rgba(34,197,94,.28);
}

.latest-badge.update {
background: rgba(168,85,247,.16);
color: #c4b5fd;
border: 1px solid rgba(168,85,247,.28);
}

.card-meta {
color: var(--muted2);

font-size: 9px;

}

.card-tag {
display: inline-block;

margin-top: 8px;

padding: 4px 6px;

background: #1c1329;

color: #a994c4;

border-radius: 4px;

font-size: 8px;

}

/* DETAIL */

.detail-page {
padding:
35px 0 90px;
}

.detail-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border2);
    background: #120d1c;
    color: #bda9db;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 11px;
    text-decoration: none;
    cursor: pointer;
    margin-bottom: 22px;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.detail-back:hover,
.detail-back:focus-visible {
    color: white;
    border-color: var(--purple);
    background: #191126;
}

.detail-back:active {
    color: white;
    border-color: var(--purple);
    background: #211631;
}

.detail-layout {
display: flex;

gap: 30px;

}

.detail-poster {
width: 320px;
min-width: 320px;
height: 320px;

position: relative;
overflow: hidden;
border-radius: 8px;

background: #15101f;

}

.detail-poster img {
width: 100%;
height: 100%;
display: block;
object-fit: contain;
object-position: center;
}

.detail-content {
flex: 1;
}

.detail-type {
color: var(--purple2);

font-size: 10px;

font-weight: 700;

letter-spacing: 2px;

margin-bottom: 8px;

}

.detail-content h1 {
margin: 0 0 10px;

font-size: 40px;

}

.detail-info {
color: var(--muted);

font-size: 12px;

margin-bottom: 22px;

}

.detail-description {
max-width: 750px;

color: #aaa0b4;

line-height: 1.8;

font-size: 13px;

margin-bottom: 25px;

text-align: justify;
}

.detail-description p {
margin: 0 0 14px;
text-align: justify;
text-indent: 1.5em;
}

.detail-description p:last-child {
margin-bottom: 0;
}

.detail-support {
display: inline-block;

margin-bottom: 30px;

padding: 10px 15px;

background: #7c3aed;

border-radius: 6px;

font-size: 11px;

font-weight: 700;

}

.episode-title {
margin: 0 0 12px;

font-size: 17px;

}

.episode-list {
display: flex;

flex-wrap: wrap;

gap: 8px;

}

.episode-btn {
padding: 9px 13px;

background: #181024;

border:
    1px solid #382653;

border-radius: 5px;

color: #c0add7;

font-size: 10px;

font-weight: 700;

}

.episode-btn:hover {
background: var(--purple);

color: white;

border-color: var(--purple);

}

/* CHAT */

.chat-toggle {
position: fixed;

right: 20px;
bottom: 20px;

z-index: 300;

width: 54px;
height: 54px;

border: 0;

border-radius: 50%;

background: var(--purple);

color: white;

font-size: 21px;

box-shadow:
    0 8px 30px rgba(0,0,0,.4);

}

.chat-box {
position: fixed;

right: 20px;
bottom: 85px;

z-index: 299;

width: 340px;

display: none;

overflow: hidden;

border:
    1px solid var(--border2);

border-radius: 9px;

background: #0e0a16;

box-shadow:
    0 20px 60px rgba(0,0,0,.55);

}

.chat-box.open {
display: block;
}

.chat-header {
display: flex;

align-items: center;
justify-content: space-between;

padding: 13px;

border-bottom:
    1px solid var(--border);

}

.chat-header strong {
display: block;

font-size: 12px;

}

.chat-header small {
display: block;

margin-top: 3px;

color: var(--muted2);

font-size: 9px;

}

.chat-header button {
border: 0;

background: none;

color: var(--muted);

font-size: 22px;

}

.chat-messages {
height: 260px;

padding: 12px;

overflow-y: auto;

}

.chat-message {
padding: 9px;

margin-bottom: 8px;

border-radius: 6px;

background: #151020;

}

.chat-message strong {
color: var(--purple2);

font-size: 10px;

}

.chat-message p {
margin: 4px 0 0;

color: #c2b8cb;

font-size: 11px;

line-height: 1.5;

overflow-wrap: anywhere;

}

.chat-message time {
display: block;

margin-top: 5px;

color: #5e5668;

font-size: 8px;

}

.chat-form {
padding: 10px;

border-top:
    1px solid var(--border);

}

.chat-form input,
.chat-form textarea {
width: 100%;

border:
    1px solid #30233f;

background: #09070e;

color: white;

outline: none;

border-radius: 5px;

padding: 8px;

margin-bottom: 7px;

font-size: 10px;

}

.chat-form textarea {
min-height: 55px;

resize: vertical;

}

.chat-form button {
width: 100%;

padding: 8px;

border: 0;

border-radius: 5px;

background: var(--purple);

color: white;

font-size: 10px;

font-weight: 700;

}

/* FOOTER */

footer {
border-top:
1px solid #21172e;

background: #060509;

}

.footer-inner {
min-height: 130px;

display: flex;

align-items: center;

justify-content: space-between;

gap: 20px;

}

.footer-inner p {
color: var(--muted2);

font-size: 10px;

}

.footer-inner .logo img {
    width: 210px !important;
    height: auto !important;
    max-width: 210px !important;
    max-height: 72px !important;
}


.visitor-box {
display: flex;

flex-direction: column;

align-items: center;

gap: 5px;

color: var(--muted2);

font-size: 10px;

}

.visitor-box strong {
color: var(--purple2);

font-size: 20px;

}

.footer-support {
color: #bda7dc;
font-size: 10px;
}

.footer-links {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.social-links {
    display: flex;
    gap: 12px;
}

.social-links a {
    color: #bda7dc;
    font-size: 10px;
}

.social-links a:hover,
.footer-support:hover {
    color: white;
}

.copyright {
padding: 16px;

text-align: center;

color: #b8acbf;

border-top:
    1px solid #2a2032;

font-size: 10px;

font-weight: 600;

letter-spacing: .2px;

}

/* ADMIN */

.admin-page {
padding:
45px 0 100px;
}

.admin-title {
display: flex;

align-items: end;
justify-content: space-between;

gap: 20px;

margin-bottom: 30px;

}

.admin-title h1 {
margin: 0 0 8px;

font-size: 38px;

}

.admin-title p:not(.eyebrow) {
margin: 0;

color: var(--muted);

font-size: 11px;

}

.primary-btn,
.danger-btn {
border: 0;

padding: 10px 15px;

border-radius: 6px;

color: white;

font-size: 11px;

font-weight: 700;

}

.primary-btn {
background: var(--purple);
}

.primary-btn:hover {
background: #9b6bff;
}

.danger-btn {
background: #3b1625;

color: #ff9bb3;

border: 1px solid #61243a;

}

.full {
width: 100%;
}

.stats-grid {
display: grid;

grid-template-columns:
    repeat(4,1fr);

gap: 12px;

margin-bottom: 35px;

}

.stat-card {
padding: 18px;

border:
    1px solid var(--border);

border-radius: 8px;

background: var(--card);

}

.stat-card span {
display: block;

color: var(--muted2);

font-size: 10px;

margin-bottom: 8px;

}

.stat-card strong {
color: var(--purple2);

font-size: 25px;

}

.admin-section {
margin-bottom: 40px;
}

.admin-section-head {
display: flex;

align-items: end;
justify-content: space-between;

gap: 15px;

margin-bottom: 16px;

}

.admin-section-head h2 {
margin: 0;

font-size: 21px;

}

.admin-filter {
display: flex;

gap: 5px;

}

.filter-admin {
border:
1px solid var(--border);

background: #110c19;

color: var(--muted);

padding: 7px 10px;

border-radius: 5px;

font-size: 9px;

}

.filter-admin.active {
background: #27163d;

color: var(--purple2);

border-color: #5d3d82;

}

.settings-form {
display: grid;

grid-template-columns:
    repeat(3, minmax(0, 1fr));

align-items: end;

gap: 10px;

padding: 17px;

border:
    1px solid var(--border);

border-radius: 8px;

background: var(--card);

}

.settings-form label,
.modal-card label {
display: block;

margin-bottom: 6px;

color: #a79baa;

font-size: 10px;

}

.settings-form input,
.modal-card input,
.modal-card select,
.modal-card textarea {
width: 100%;

padding: 10px;

border:
    1px solid #30233f;

border-radius: 5px;

background: #09070e;

color: white;

outline: none;

font-size: 11px;

}

.settings-form input:focus,
.modal-card input:focus,
.modal-card select:focus,
.modal-card textarea:focus {
border-color: var(--purple);
}

.admin-item {
margin-bottom: 12px;

padding: 15px;

border:
    1px solid var(--border);

border-radius: 8px;

background: var(--card);

}

.admin-item-top {
display: flex;

align-items: flex-start;

justify-content: space-between;

gap: 15px;

}

.admin-item-title {
font-size: 15px;

font-weight: 700;

margin-bottom: 5px;

}

.admin-item-meta {
color: var(--muted2);

font-size: 9px;

}

.admin-actions {
display: flex;

flex-wrap: wrap;

gap: 5px;

}

.action-btn {
padding: 7px 9px;

border:
    1px solid #37264d;

border-radius: 5px;

background: #171020;

color: #aaa0b3;

font-size: 9px;

}

.action-btn:hover {
color: white;

border-color: var(--purple);

}

.action-btn.delete:hover {
color: #ff91aa;

border-color: var(--danger);

}

.admin-episodes {
margin-top: 13px;

padding-top: 10px;

border-top:
    1px solid #20172c;

}

.admin-episode {
display: flex;

align-items: center;
justify-content: space-between;

gap: 10px;

padding: 8px 0;

border-bottom:
    1px solid #191321;

}

.admin-episode:last-child {
border-bottom: 0;
}

.admin-episode-info {
min-width: 0;
}

.admin-episode-info strong {
font-size: 10px;
}

.admin-episode-url {
max-width: 500px;

margin-top: 3px;

overflow: hidden;

text-overflow: ellipsis;

white-space: nowrap;

color: #62596c;

font-size: 8px;

}

.admin-chat {
display: flex;

align-items: center;

justify-content: space-between;

gap: 15px;

padding: 12px;

margin-bottom: 7px;

border:
    1px solid var(--border);

background: var(--card);

border-radius: 6px;

}

.admin-chat-message strong {
color: var(--purple2);

font-size: 10px;

}

.admin-chat-message p {
margin: 5px 0;

color: #b4a9bd;

font-size: 10px;

}

.admin-chat-message small {
color: #5f5668;

font-size: 8px;

}

/* MODAL */

.modal {
position: fixed;

inset: 0;

z-index: 500;

display: none;

align-items: flex-start;
justify-content: center;

padding: 20px;

background: rgba(0,0,0,.78);

overflow-y: auto;

}

.modal.open {
display: flex;
}

.modal-card {
width: 100%;

max-width: 520px;
max-height: calc(100vh - 40px);
overflow-y: auto;
overscroll-behavior: contain;

padding: 22px;

border:
    1px solid var(--border2);

border-radius: 9px;

background: #100b18;

box-shadow:
    0 25px 80px rgba(0,0,0,.6);

}

.modal-head {
position: sticky;
top: -22px;
z-index: 2;
display: flex;

align-items: center;
justify-content: space-between;

margin-bottom: 18px;
padding: 22px 0 12px;
background: #100b18;

}

.modal-head h2 {
margin: 0;

font-size: 18px;

}

.modal-close {
border: 0;

background: none;

color: var(--muted);

font-size: 25px;

}

.modal-card label {
margin-top: 11px;
}

.modal-card textarea {
min-height: 100px;

resize: vertical;

}

.checkbox-label {
display: flex !important;

align-items: center;

gap: 7px;

}

.checkbox-label input {
width: auto;
}

/* EMPTY */

.empty {
padding: 50px 20px;

text-align: center;

color: var(--muted2);

border:
    1px dashed #30233f;

border-radius: 8px;

}

/* RESPONSIVE */

@media (max-width: 1000px) {

.content-grid {
    grid-template-columns:
        repeat(auto-fit, minmax(320px, 320px));
    justify-content: center;
}

.main-nav {
    gap: 12px;
}

}

@media (max-width: 760px) {
    .header-actions {
        width: 100%;
        justify-content: flex-end;
        margin-left: 0;
        flex-wrap: wrap;
    }

    .header-socials {
        display: flex;
    }
    .nav-wrap .logo img {
        width: 190px !important;
        height: auto !important;
        max-width: 190px !important;
        max-height: 68px !important;
    }

.main-nav {
    order: 3;

    width: 100%;

    justify-content: flex-start;

    overflow-x: auto;

    padding-bottom: 2px;
}

.main-nav a {
    white-space: nowrap;
}

.content-grid {
    grid-template-columns:
        repeat(auto-fit, minmax(320px, 320px));
    justify-content: center;
}

.detail-layout {
    flex-direction: column;
}

.detail-poster {
    width: 320px;
    min-width: 320px;
    max-width: 320px;
    height: 320px;
}

.stats-grid {
    grid-template-columns:
        repeat(2,1fr);
}

.settings-form {
    grid-template-columns: 1fr;
}

.admin-title {
    align-items: flex-start;

    flex-direction: column;
}

}

@media (max-width: 500px) {

.hero {
    min-height: 390px;
}

.hero h1 {
    font-size: 39px;
}

.content-grid {
    grid-template-columns:
        320px;
    justify-content: center;

    gap: 10px;
}

.chat-box {
    right: 10px;
    bottom: 78px;

    width:
        calc(100% - 20px);
}

.chat-toggle {
    right: 14px;
    bottom: 14px;
}

.footer-inner {
    align-items: flex-start;

    flex-direction: column;

    padding: 25px 0;
}

.admin-item-top {
    flex-direction: column;
}

.admin-episode {
    align-items: flex-start;

    flex-direction: column;
}

}
/* BRAND IMAGE UPLOAD */
.branding-upload-group {
    min-width: 0;
}

.image-dropzone {
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 14px;
    border: 1px dashed #4a3564;
    border-radius: 7px;
    background: #0b0811;
    cursor: pointer;
    transition: .2s;
    overflow: hidden;
}

.image-dropzone:hover,
.image-dropzone.dragover,
.image-dropzone:focus {
    border-color: var(--purple);
    background: #120d1c;
    outline: none;
}

.image-dropzone-text {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: var(--muted);
    font-size: 9px;
    text-align: center;
}

.image-dropzone-text strong {
    color: #c9b9da;
    font-size: 10px;
}

.image-dropzone-text span {
    color: var(--muted2);
}

.image-upload-preview {
    display: block;
    width: 110px;
    height: 55px;
    object-fit: contain;
    border-radius: 4px;
    background: #151020;
}

.image-upload-preview:not(.has-image) {
    display: none;
}

.favicon-preview {
    width: 48px;
    height: 48px;
}

.image-dropzone-small {
    min-height: 120px;
}

@media (max-width: 760px) {
    .image-dropzone {
        min-height: 100px;
    }
}


/* Poster URL + MyDramaList importer */
.poster-drop-zone { margin-top:12px; min-height:92px; border:1.5px dashed rgba(255,255,255,.28); border-radius:14px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:6px; text-align:center; cursor:pointer; transition:.15s ease; background:rgba(255,255,255,.025); }
.poster-drop-zone:hover, .poster-drop-zone.dragover { border-color:rgba(255,255,255,.7); background:rgba(255,255,255,.06); transform:translateY(-1px); }
.poster-drop-zone span { font-size:12px; opacity:.65; }
.poster-url-row { display:flex; gap:10px; align-items:stretch; }
.poster-url-row input { flex:1; min-width:0; }
.poster-url-row .secondary-btn { white-space:nowrap; }
.form-hint { margin:7px 0 0; font-size:12px; opacity:.68; }
.admin-poster-preview { margin-top:12px; width:320px; height:320px; border-radius:12px; overflow:hidden; border:1px solid rgba(255,255,255,.12); background:#111; }
.admin-poster-preview img { width:100%; height:100%; display:block; object-fit:contain; object-position:center; }
@media (max-width:600px) { .poster-url-row { flex-direction:column; } .poster-url-row .secondary-btn { width:100%; } }


/* Modal content: always accessible on normal screens without zooming */
@media (max-height: 700px) {
  .modal { padding: 10px; }
  .modal-card { max-height: calc(100vh - 20px); padding: 16px; }
  .modal-head { top: -16px; padding-top: 16px; }
}


/* Pagination Terbaru */
.pagination{display:flex;justify-content:center;align-items:center;gap:7px;margin:28px 0;flex-wrap:wrap}.pagination-btn{min-width:38px;height:38px;border:1px solid var(--border);border-radius:7px;background:var(--card);color:var(--text);cursor:pointer;font:inherit}.pagination-btn:hover,.pagination-btn.active{background:#60428d;color:#fff;border-color:#60428d}.pagination-arrow{font-size:22px;line-height:1}.pagination-ellipsis{display:inline-flex;align-items:center;justify-content:center;min-width:24px;height:38px;color:var(--muted2);font-size:18px;user-select:none}

/* COMPACT CATALOG LAYOUT — poster tetap 320x320 */
.catalog { max-width: 1120px; margin-left: auto; margin-right: auto; padding-top: 20px; padding-bottom: 55px; }
.section-head { margin-bottom: 14px; }
.section-head h2 { font-size: 23px; }
.content-grid { gap: 12px; grid-template-columns: repeat(auto-fit, 320px); }
.content-card { border-radius: 7px; }
.content-card .card-info { padding: 10px 11px; }
.content-card .card-title { font-size: 14px; line-height: 1.3; }
.content-card .card-meta { font-size: 10px; }
.content-card .card-episodes { font-size: 10px; }
.content-card .card-date { font-size: 9px; }

@media (max-width: 760px) {
  .catalog { width: 100%; box-sizing: border-box; padding-left: 10px; padding-right: 10px; }
  .content-grid { grid-template-columns: minmax(0, 320px); }
}

@media (max-width: 350px) {
  .poster { width: 100%; height: auto; aspect-ratio: 1 / 1; }
  .content-grid { grid-template-columns: 1fr; }
}


/* FINAL CATALOG: 4 columns x 3 rows, compact posters */
.catalog { max-width: 1040px; }
.content-grid {
    grid-template-columns: repeat(4, 240px);
    gap: 14px;
    justify-content: center;
}
.content-card .poster {
    width: 240px;
    height: 240px;
}
.content-card .poster img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}
@media (max-width: 1040px) {
    .content-grid {
        grid-template-columns: repeat(3, 240px);
    }
}
@media (max-width: 780px) {
    .content-grid {
        grid-template-columns: repeat(2, 240px);
    }
}
@media (max-width: 520px) {
    .content-grid {
        grid-template-columns: minmax(0, 240px);
    }
    .content-card .poster {
        width: 240px;
        height: 240px;
    }
}

/* Content cards are clickable */
.content-card { cursor: pointer; }


/* Trakteer official uploaded brand artwork */
.trakteer-button{background:#bf1e2e!important;display:inline-flex;align-items:center;justify-content:center;overflow:hidden;}
.trakteer-button img{display:block;width:auto;height:22px;max-width:100%;object-fit:contain;}
.support-btn.trakteer-button{min-width:108px;height:34px;padding:3px 7px;border-radius:7px;}
.footer-support.trakteer-button{min-width:142px;height:42px;padding:4px 10px;border-radius:8px;}
/* Detail-page support: red Trakteer brand, no purple background */
.detail-support{background:#bf1e2e!important;padding:7px 11px!important;border-radius:7px!important;display:inline-flex!important;align-items:center;justify-content:center;}
.detail-support .trakteer-brand-image{height:29px;width:auto;display:block;margin:0 auto;}
.trakteer-brand-image{height:26px;width:auto;max-width:100%;object-fit:contain;vertical-align:middle;}

/* Final Trakteer detail override */
.detail-support{background:#bf1e2e!important;color:#fff!important;}

/* Sembunyikan label "Konten"/label tipe pada halaman detail tanpa mengubah elemen lain. */
.detail-page .detail-type { display: none !important; }

/* Pada halaman detail, jumlah "konten" tidak ditampilkan. */
.detail-page ~ * { }


/* MOBILE NAVIGATION FIX: keep all primary categories visible and horizontally scrollable */
@media (max-width: 760px) {
  .header {
    overflow: visible;
  }
  .nav-wrap {
    width: 100%;
    max-width: none;
    min-height: auto;
    padding: 8px 10px 7px;
    box-sizing: border-box;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
  }
  .nav-wrap .logo {
    flex: 0 0 auto;
  }
  .nav-wrap .logo img {
    width: 145px !important;
    max-width: 145px !important;
    max-height: 48px !important;
  }
  .header-actions {
    width: auto;
    margin-left: auto;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 5px;
  }
  .header-socials {
    display: flex !important;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
  }
  .header-socials a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    font-size: 10px;
    line-height: 1;
    padding: 5px 4px;
  }
  .support-btn.trakteer-button {
    min-width: 76px;
    height: 30px;
    padding: 2px 5px;
  }
  .support-btn.trakteer-button img {
    height: 19px;
  }
  .admin-btn {
    padding: 7px 8px;
    font-size: 10px;
  }
  .main-nav {
    order: 3;
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
    display: flex !important;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 7px 2px 5px;
    margin: 0;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .main-nav a {
    flex: 0 0 auto;
    display: inline-flex !important;
    visibility: visible !important;
    white-space: nowrap;
    font-size: 11px;
  }
}

@media (max-width: 380px) {
  .nav-wrap .logo img {
    width: 125px !important;
    max-width: 125px !important;
  }
  .main-nav {
    gap: 10px;
  }
  .main-nav a {
    font-size: 10px;
  }
}

/* EPISODE GRID: 8 per row on desktop, 4 per row on mobile */
.episode-list {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
}
.episode-btn {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    text-align: center;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    overflow-wrap: anywhere;
    min-height: 36px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 760px) {
    .episode-list {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 8px;
    }
}

/* Keep episode labels on a single line and fully visible */
.episode-list { overflow: visible; }
.episode-btn {
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    font-size: 10px;
    padding-left: 4px;
    padding-right: 4px;
}
@media (max-width: 760px) {
    .episode-btn {
        font-size: 10px;
        padding-left: 2px;
        padding-right: 2px;
    }
}

/* ADMIN CATALOG: compact searchable list */
.admin-catalog-tools { margin-bottom: 10px; }
.admin-catalog-tools input { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #30233f; border-radius: 6px; background: #09070e; color: white; outline: none; font-size: 11px; }
.admin-catalog-tools input:focus { border-color: var(--purple); }
#adminContent { display: flex; flex-direction: column; gap: 5px; }
#adminContent .admin-item { margin: 0; padding: 9px 11px; border-radius: 6px; }
#adminContent .admin-item-top { align-items: center; gap: 10px; }
#adminContent .admin-item-title { margin-bottom: 2px; font-size: 12px; }
#adminContent .admin-item-meta { font-size: 8px; }
#adminContent .admin-actions { flex-shrink: 0; }
#adminContent .admin-episodes { margin-top: 8px; padding-top: 7px; }
@media (max-width: 700px) {
  #adminContent .admin-item-top { align-items: flex-start; flex-direction: column; }
  #adminContent .admin-actions { width: 100%; }
}

/* ADMIN CATALOG: tampilkan 5 item dulu, sisanya lewat tombol */
.admin-show-more {
    display: block;
    width: 100%;
    margin: 4px 0 8px;
    padding: 8px 10px;
    border: 1px solid #37264d;
    border-radius: 6px;
    background: #171020;
    color: #aaa0b3;
    font-size: 9px;
    cursor: pointer;
}
.admin-show-more:hover {
    color: white;
    border-color: var(--purple);
}
.admin-show-more-contents {
    margin-top: 2px;
}

/* ADMIN CATALOG: each title is a collapsible episode section */
.admin-title-toggle-wrap {
    min-width: 0;
    flex: 1;
}

.admin-title-toggle {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    text-align: left;
    cursor: pointer;
}

.admin-title-toggle:hover .admin-item-title {
    color: #fff;
}

.admin-title-arrow {
    flex: 0 0 auto;
    width: 10px;
    color: var(--purple);
    font-size: 9px;
}

.admin-title-toggle .admin-item-title {
    margin-bottom: 0;
}

/* CATEGORY BUTTONS: match the hover/active style of the Back/Website button */
.main-nav a {
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
    color: white;
    border-color: var(--purple);
    background: #191126;
}

.main-nav a:active {
    color: white;
    border-color: var(--purple);
    background: #211631;
}

@media (max-width: 760px) {
    .main-nav a {
        padding: 7px 10px;
    }
}


/* FINAL MOBILE CATEGORY FIX: keep every category label on a single line */
@media (max-width: 760px) {
  .main-nav {
    flex-wrap: nowrap !important;
    gap: 6px !important;
    padding-left: 1px;
    padding-right: 1px;
  }
  .main-nav a {
    flex: 0 0 auto !important;
    width: max-content !important;
    min-width: max-content !important;
    max-width: none !important;
    white-space: nowrap !important;
    overflow: visible !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    writing-mode: horizontal-tb !important;
    font-size: 10px !important;
    padding: 6px 7px !important;
  }
}

@media (max-width: 380px) {
  .main-nav {
    gap: 4px !important;
  }
  .main-nav a {
    font-size: 9px !important;
    padding: 6px 6px !important;
  }
}

/* FINAL: Japanese category label must never wrap */
.main-nav a {
    white-space: nowrap !important;
    text-wrap: nowrap !important;
    word-break: keep-all !important;
    overflow-wrap: normal !important;
    line-break: strict !important;
    display: inline-block !important;
}
@media (max-width: 760px) {
    .main-nav {
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        white-space: nowrap !important;
    }
    .main-nav a {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: fit-content !important;
        max-width: none !important;
        white-space: nowrap !important;
        text-wrap: nowrap !important;
    }
}


/* KATEGORI: Series, Movie, Special dijadikan satu menu list */
.nav-category-menu {
    position: relative;
    display: inline-block;
    flex: 0 0 auto;
}

.nav-category-menu summary {
    list-style: none;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
    cursor: pointer;
    border: 1px solid transparent;
    background: transparent;
    color: var(--muted);
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 12px;
    line-height: 1;
    transition: color .15s ease, border-color .15s ease, background .15s ease;
}

.nav-category-menu summary::-webkit-details-marker {
    display: none;
}

.nav-category-menu summary::after {
    content: "▾";
    margin-left: 5px;
    font-size: 9px;
}

.nav-category-menu[open] summary,
.nav-category-menu summary:hover,
.nav-category-menu summary:focus-visible {
    color: white;
    border-color: var(--purple);
    background: #191126;
}

.nav-category-list {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    z-index: 1000;
    min-width: 120px;
    padding: 5px;
    border: 1px solid var(--border2);
    border-radius: 7px;
    background: #120d1c;
    box-shadow: 0 10px 25px rgba(0,0,0,.35);
}

.nav-category-list a {
    display: flex !important;
    width: 100% !important;
    box-sizing: border-box;
    white-space: nowrap !important;
    margin: 0;
}

.nav-category-list a:hover,
.nav-category-list a:focus-visible {
    color: white;
    border-color: var(--purple);
    background: #191126;
}

@media (max-width: 760px) {
    .nav-category-menu summary {
        font-size: 10px;
        padding: 6px 7px;
    }
    .nav-category-list {
        min-width: 105px;
    }
    .nav-category-list a {
        font-size: 10px !important;
        padding: 7px 8px !important;
    }
}

@media (max-width: 380px) {
    .nav-category-menu summary {
        font-size: 9px;
        padding: 6px;
    }
}


/* Animasi dropdown Kategori / Status */
.nav-category-menu .nav-category-list {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-7px) scale(.98);
    transform-origin: top left;
    transition: opacity .22s ease, transform .22s ease, visibility 0s linear .22s;
}

.nav-category-menu.is-opening .nav-category-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    transition-delay: 0s;
}

.nav-category-menu.is-closing .nav-category-list {
    opacity: 0;
    visibility: hidden;
    transform: translateY(-7px) scale(.98);
    transition-delay: 0s, 0s, .22s;
}

.nav-category-menu[open]:not(.is-closing) .nav-category-list {
    visibility: visible;
}

@media (prefers-reduced-motion: reduce) {
    .nav-category-menu .nav-category-list {
        transition: none;
    }
}

/* STATUS: Ongoing dan Completed dijadikan satu menu list */
.nav-status-menu .nav-category-list {
    min-width: 115px;
}


/* MOBILE DROPDOWN FIX: keep dropdown visible above the horizontally scrolling nav */
@media (max-width: 760px) {
  .nav-category-menu .nav-category-list {
    position: fixed;
    left: var(--dropdown-left, 8px);
    top: var(--dropdown-top, 50px);
    z-index: 99999;
    margin: 0;
    max-width: calc(100vw - 16px);
  }
}


/* Visitor analytics */
.visitor-box {
    flex-direction: row;
    justify-content: center;
    gap: 24px;
    flex-wrap: wrap;
}

.visitor-box > div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.visitor-box span {
    white-space: nowrap;
}

.visitor-history-table-wrap {
    overflow-x: auto;
}

.visitor-history-table {
    width: 100%;
    border-collapse: collapse;
}

.visitor-history-table th,
.visitor-history-table td {
    padding: 11px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border, rgba(255,255,255,.08));
}

.visitor-history-table th:last-child,
.visitor-history-table td:last-child {
    text-align: right;
}

@media (max-width: 600px) {
    .visitor-box {
        gap: 18px;
    }
}


/* Admin authentication */
.admin-header-actions{display:flex;align-items:center;gap:10px}
.admin-login-gate{position:fixed;inset:0;z-index:9999;display:grid;place-items:center;padding:20px;background:rgba(10,8,14,.72);backdrop-filter:blur(10px)}
.admin-login-gate[hidden]{display:none}
.admin-login-card{width:min(430px,100%);padding:32px;border:1px solid rgba(255,255,255,.1);border-radius:18px;background:var(--card-bg,#17131d);box-shadow:0 24px 80px rgba(0,0,0,.35)}
.admin-login-card h1{margin:4px 0 8px}.admin-login-card>p:not(.eyebrow){margin-bottom:22px;color:#aaa}
.admin-login-card label{display:block;margin:14px 0 7px;font-weight:600}
.admin-login-card input{width:100%;box-sizing:border-box}
.admin-login-error{min-height:20px;margin:12px 0 0;color:#ff7d8a;font-size:.9rem}
.admin-locked #adminMain,.admin-locked header .admin-header-actions{visibility:hidden}
@media(max-width:600px){.admin-header-actions{gap:6px}.admin-header-actions .danger-btn{padding:8px 10px}}

.chat-reply {
margin-top: 8px;
padding: 7px 8px;
border-left: 2px solid var(--purple2);
background: rgba(120, 90, 160, .08);
border-radius: 4px;
}
.chat-reply strong { color: var(--purple2); }
.chat-reply p { margin: 3px 0 0; }

.admin-chat-message {
flex: 1;
min-width: 0;
}
.admin-chat-reply {
margin-top: 8px;
padding: 8px;
border-left: 2px solid var(--purple2);
background: rgba(120, 90, 160, .08);
border-radius: 4px;
}
.admin-chat-reply p { margin: 4px 0; }
.admin-chat-reply-input {
width: 100%;
min-height: 54px;
margin-top: 8px;
resize: vertical;
box-sizing: border-box;
}
.admin-chat-message > .action-btn {
margin-top: 7px;
}

/* Chat bubbles — WhatsApp / Telegram style */
.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 7px;
}
.chat-bubble-row { display:flex; width:100%; }
.chat-bubble-row.sent { justify-content:flex-end; }
.chat-bubble-row.received { justify-content:flex-start; }
.chat-bubble {
    max-width: 78%;
    padding: 7px 10px 5px;
    border-radius: 12px;
    box-sizing: border-box;
}
.chat-bubble.sent { border-bottom-right-radius: 4px; background: #eee8f5; }
.chat-bubble.received { border-bottom-left-radius: 4px; background: #f5f1f8; }
.chat-bubble strong { display:block; font-size:10px; margin-bottom:2px; }
.chat-bubble p { margin:0; font-size:12px; line-height:1.4; white-space:pre-wrap; word-break:break-word; }
.chat-bubble time { display:block; text-align:right; font-size:8px; opacity:.65; margin-top:3px; }
.chat-name-locked { opacity:.8; cursor:not-allowed; }

.admin-chat-thread { border:1px solid rgba(80,55,100,.12); border-radius:14px; padding:12px; margin-bottom:14px; }
.admin-chat-thread-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:9px; }
.admin-chat-thread-head strong { font-size:13px; }
.admin-chat-thread-head span { font-size:10px; opacity:.65; }
.admin-chat-thread-messages { display:flex; flex-direction:column; gap:7px; max-height:360px; overflow:auto; padding:4px; }
.admin-chat-bubble-row { display:flex; width:100%; }
.admin-chat-bubble-row.sent { justify-content:flex-end; }
.admin-chat-bubble-row.received { justify-content:flex-start; }
.admin-chat-bubble { max-width:75%; padding:7px 10px 5px; border-radius:12px; }
.admin-chat-bubble.sent { background:#eee8f5; border-bottom-right-radius:4px; }
.admin-chat-bubble.received { background:#f5f1f8; border-bottom-left-radius:4px; }
.admin-chat-bubble strong { display:block; font-size:10px; margin-bottom:2px; }
.admin-chat-bubble p { margin:0; font-size:12px; line-height:1.4; white-space:pre-wrap; word-break:break-word; }
.admin-chat-bubble small { display:block; text-align:right; font-size:8px; opacity:.65; margin-top:3px; }
.admin-chat-compose { display:flex; gap:8px; margin-top:10px; align-items:flex-end; }
.admin-chat-compose textarea { flex:1; min-height:38px; max-height:100px; resize:none; border:1px solid rgba(80,55,100,.16); border-radius:10px; padding:8px 10px; font:inherit; }
.admin-chat-delete { margin-top:8px; }

/* Chat readability: larger text + high-contrast bubbles */
.chat-bubble {
    padding: 10px 13px 7px;
    border-radius: 14px;
}
.chat-bubble.sent {
    background: #6b4aa0;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}
.chat-bubble.received {
    background: #e8e8ed;
    color: #202124;
    border-bottom-left-radius: 4px;
}
.chat-bubble strong { font-size: 12px; color: inherit; margin-bottom: 4px; }
.chat-bubble p { font-size: 15px; line-height: 1.5; color: inherit; }
.chat-bubble time { font-size: 10px; color: inherit; opacity: .72; margin-top: 5px; }

.admin-chat-bubble {
    max-width: 75%;
    padding: 10px 13px 7px;
    border-radius: 14px;
}
.admin-chat-bubble.sent {
    background: #6b4aa0;
    color: #ffffff;
    border-bottom-right-radius: 4px;
}
.admin-chat-bubble.received {
    background: #e8e8ed;
    color: #202124;
    border-bottom-left-radius: 4px;
}
.admin-chat-bubble strong { font-size: 12px; color: inherit; margin-bottom: 4px; }
.admin-chat-bubble p { font-size: 15px; line-height: 1.5; color: inherit; }
.admin-chat-bubble small { font-size: 10px; color: inherit; opacity: .72; margin-top: 5px; }


/* Chat unread badges */
/* Keep the floating Chat button in its original fixed position; badge is absolute and does not affect layout. */
.chat-toggle { position: fixed; }
.chat-notification-badge,
.admin-chat-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e53935;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    box-sizing: border-box;
}
.chat-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    border: 2px solid #0e0a16;
}
.admin-chat-badge {
    vertical-align: middle;
    margin-left: 5px;
}

.chat-room-tabs{display:flex;gap:6px;padding:8px;background:#f5f1f8;border-bottom:1px solid #ddd;}.chat-room-tab{flex:1;border:0;border-radius:8px;padding:9px 10px;background:transparent;cursor:pointer;font-weight:600;color:#62596c;}.chat-room-tab.active{background:#fff;color:#5b2b82;box-shadow:0 1px 4px rgba(0,0,0,.08);}

/* Official Arnormality identity in group chat */
.chat-bubble.official {
    background: #f0e7f8;
    color: #3f2456;
    border: 1px solid #8b5bb5;
    box-shadow: 0 1px 3px rgba(91,43,130,.10);
}
.chat-bubble.official strong,
.admin-chat-bubble.official strong {
    color: #6b3c91;
}
.official-chat-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #6b3c91;
    font-weight: 800;
    font-size: 12px;
}
.admin-chat-bubble.official {
    background: #eee2f6;
    color: #3f2456;
    border: 1px solid #8b5bb5;
}


/* Initial catalog loading: keep the default HTML from flashing before Supabase data arrives. */
.catalog-loading {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #9f96aa;
    font-size: 13px;
    text-align: center;
}

.catalog-loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid rgba(255,255,255,.12);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: arnormality-loading-spin .7s linear infinite;
}

@keyframes arnormality-loading-spin {
    to { transform: rotate(360deg); }
}


/* Pastikan setiap paragraf sinopsis, termasuk paragraf ke-2 dan seterusnya,
   selalu menjorok di awal baris. */
.detail-description p {
    display: block;
    margin: 0 0 14px !important;
    padding: 0 !important;
    text-align: justify !important;
    text-indent: 1.5em !important;
}

.detail-description p + p {
    margin-top: 0 !important;
    text-indent: 1.5em !important;
}


.search-box-wrap {
    position: relative;
    width: 100%;
}

.search-box-wrap #searchInput {
    width: 100%;
    padding-right: 42px;
}

.search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #8f849b;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: .18s ease;
}

.search-clear:hover {
    color: #fff;
    background: rgba(167, 139, 250, .12);
}

.search-clear[hidden] {
    display: none;
}


/* CHAT REPLY */
.chat-reply-bar[hidden], .admin-chat-reply-bar[hidden] { display: none !important; }

.chat-reply-bar, .admin-chat-reply-bar {
    display:flex; align-items:center; justify-content:space-between; gap:8px;
    padding:7px 10px; border-left:3px solid var(--purple);
    background:#151020; border-bottom:1px solid var(--border); font-size:9px;
}
.chat-reply-bar > div, .admin-chat-reply-bar > div { min-width:0; display:flex; flex-direction:column; gap:2px; }
.chat-reply-bar strong, .admin-chat-reply-bar strong { color:#cbb8ff; }
.chat-reply-bar span, .admin-chat-reply-bar span { color:var(--muted2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:250px; }
.chat-reply-bar button, .admin-chat-reply-bar button { border:0; background:none; color:var(--muted); font-size:18px; cursor:pointer; }
.chat-bubble-meta, .admin-chat-meta { display:flex; align-items:center; justify-content:space-between; gap:8px; margin-top:5px; }
.chat-bubble-meta time { margin-top:0; }
.chat-reply-btn, .admin-chat-reply-btn { border:0; background:none; color:#9d7cff; font-size:8px; cursor:pointer; padding:0; }
.admin-chat-actions { display:inline-flex; align-items:center; gap:6px; }
.admin-chat-edit-btn, .admin-chat-delete-btn { border:0; background:none; color:#9d7cff; font-size:8px; cursor:pointer; padding:0; }
.admin-chat-edit-btn:hover { color:#fff; }
.admin-chat-delete-btn { color:#c56b8f; }
.admin-chat-delete-btn:hover { color:#ff9fbe; }
.chat-reply-btn:hover, .admin-chat-reply-btn:hover { color:#fff; }
.chat-reply-preview, .admin-chat-reply-preview { border-left:2px solid var(--purple); background:rgba(167,139,250,.08); padding:4px 6px; margin:5px 0; display:flex; flex-direction:column; gap:1px; font-size:8px; border-radius:3px; }
.chat-reply-preview strong, .admin-chat-reply-preview strong { color:#bfaaff; font-size:8px; }
.chat-reply-preview span, .admin-chat-reply-preview span { color:var(--muted2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }


.chat-reply-preview, .admin-chat-reply-preview { cursor: pointer; text-align: left; width: 100%; border: 0; font: inherit; }
.chat-message-highlight { animation: chatMessageHighlight 1.2s ease; }
@keyframes chatMessageHighlight { 0%, 100% { filter: none; } 25%, 70% { filter: brightness(1.55); } }

/* Chat reply readability + compact horizontal bubbles */
.chat-bubble,
.admin-chat-bubble {
    max-width: 84%;
    padding: 6px 9px 5px;
}

.chat-bubble strong,
.admin-chat-bubble strong {
    display: block;
    font-size: 11px;
    line-height: 1.2;
    margin-bottom: 3px;
    font-weight: 800;
}

.chat-bubble p,
.admin-chat-bubble p {
    font-size: 13px;
    line-height: 1.32;
    margin: 0;
}

/* Reply preview: clearly separated from the actual message */
.chat-reply-preview,
.admin-chat-reply-preview {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 7px;
    padding: 6px 9px;
    border: 0;
    border-left: 3px solid #9d7cff;
    border-radius: 6px;
    background: rgba(255,255,255,.14);
    color: #fff;
    cursor: pointer;
    text-align: left;
    font: inherit;
}

.chat-reply-preview strong,
.admin-chat-reply-preview strong {
    display: block;
    margin: 0;
    color: #e5d9ff;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
}

.chat-reply-preview span,
.admin-chat-reply-preview span {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #fff;
    font-size: 11px;
    line-height: 1.3;
}

/* Received bubbles use a light reply panel for stronger contrast */
.chat-bubble.received .chat-reply-preview,
.admin-chat-bubble.received .admin-chat-reply-preview {
    background: #ddd3e8;
    border-left-color: #76509d;
}

.chat-bubble.received .chat-reply-preview strong,
.admin-chat-bubble.received .admin-chat-reply-preview strong {
    color: #5b2b82;
}

.chat-bubble.received .chat-reply-preview span,
.admin-chat-bubble.received .admin-chat-reply-preview span {
    color: #28212f;
}

/* Official Arnormality bubble */
.chat-bubble.official .chat-reply-preview,
.admin-chat-bubble.official .admin-chat-reply-preview {
    background: #dfd0eb;
    border-left-color: #6b3c91;
}

.chat-bubble.official .chat-reply-preview strong,
.admin-chat-bubble.official .admin-chat-reply-preview strong {
    color: #5b2b82;
}

.chat-bubble.official .chat-reply-preview span,
.admin-chat-bubble.official .admin-chat-reply-preview span {
    color: #30213b;
}

.chat-reply-preview:hover,
.admin-chat-reply-preview:hover {
    filter: brightness(1.06);
}

.chat-bubble-meta,
.admin-chat-meta {
    margin-top: 5px;
}

.admin-chat-actions { display:inline-flex; align-items:center; gap:6px; margin-left:6px; }
.admin-chat-delete-btn { border:0; background:transparent; color:#a44; font-size:10px; cursor:pointer; padding:2px 4px; }
.admin-chat-delete-btn:hover { text-decoration:underline; }

/* Admin chat: separate sender name and message colors */
.admin-chat-bubble > strong {
    color: #bfaaff;
}

.admin-chat-bubble > p {
    color: #e7e0ee;
}

.admin-chat-bubble > strong .official-chat-label {
    color: #cbb8ff;
}

/* Final admin visitor-chat contrast fix */
.admin-chat-bubble.received > strong { color:#5b2b82 !important; }
.admin-chat-bubble.received > p { color:#202124 !important; }
.admin-chat-bubble.sent > strong { color:#eadfff !important; }
.admin-chat-bubble.sent > p { color:#ffffff !important; }

/* Visitor history: keep long histories inside a compact scrollable panel */
.visitor-history-table-wrap {
    max-height: 360px;
    overflow-y: auto;
    overflow-x: auto;
    border: 1px solid var(--border, rgba(255,255,255,.08));
    border-radius: 10px;
    background: rgba(0,0,0,.12);
}

.visitor-history-table {
    margin: 0;
}

.visitor-history-table thead th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--card-bg, #17131d);
}

/* Public visitor statistics are tracked in the background but shown only in Admin Panel. */
.public-visitor-stats {
    display: none !important;
}

