
@font-face {
    font-family: 'Lekton';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('font/lekton/lekton-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'Lekton';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('font/lekton/lekton-bold.woff2') format('woff2');
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('font/ibmplexmono/ibmplexmono-regular.woff2') format('woff2');
}
@font-face {
    font-family: 'IBM Plex Mono';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('font/ibmplexmono/ibmplexmono-bold.woff2') format('woff2');
}

:root {
    /* ===== Neon palette — red / cyan / yellow on near-black ===== */

    /* Base */
    --bg:            #110B11;              /* near-black */
    --surface:       #1b131c;             /* panel */
    --surface-high:  #251b27;             /* raised surface */
    --border:        rgba(249,248,248,0.07);
    --border-strong: rgba(249,248,248,0.15);
    --border-radius: 8px;
    --padding: 16px;        /* standard interior inset for windows/panes */

    /* Text — near-white */
    --text:          #F9F8F8;
    --text-muted:    rgba(249,248,248,0.50);
    --text-faint:    rgba(249,248,248,0.25);

    /* Accents */
    --accent:        #FF2E2E;             /* vivid red — primary (was pink) */
    --accent-soft:   #90F1EF;             /* cyan */
    --accent-deep:   #EAF000;             /* yellow */
    --glow:          0 0 7px rgba(255,46,46,0.55), 0 0 18px rgba(255,46,46,0.35);

    /* Surfaces meant to read as light (message bubbles) */
    --bubble:        rgba(255, 255, 255, 0.09); /* translucent white bubble */
    --bubble-text:   #FFFFFF;                    /* white text on bubble */

    /* Type */
    --font-code:    'IBM Plex Mono', monospace;             /* code / JSON viewers */
    --font-ui:      'Tahoma', 'Geneva', sans-serif;        /* primary UI: Tahoma */
    --font-ui-2:    'Tahoma', 'Geneva', sans-serif;    /* chat messages + handles */
    --font-meta:    'Tahoma', 'Geneva', sans-serif;   /* metadata */
    --font-size:    13px;
}


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

::selection {
    background: var(--accent);
    color: #FFFFFF;
}

html, body {
    width: 100%;
    height: 100%;
    background: var(--bg);
    overflow: hidden;
    font-family: var(--font-ui);
    font-size: var(--font-size);
    font-weight: 200;
    -webkit-font-smoothing: antialiased;
}

input, button, textarea, select {
    font-size: inherit;
    font-family: inherit;
}

.split-container {
    display: flex;
    width: 100%;
    height: 100%;
    padding: 20px;
    gap: 20px;
}


.panel {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    background: var(--bg);
    overflow: hidden;
}

/* === LEFT PANEL: DESKTOP === */
.desktop {
    flex: 2;
    background: var(--bg);
    position: relative;
    border: none;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 100%;
}

.desktop-canvas {
    position: relative;
    min-height: 10100px;
    padding-bottom: 200px;
}

/* Desktop icons - plaintext style */
.desktop-icon {
    position: absolute;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    user-select: none;
}

.desktop-icon .icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.desktop-icon .icon svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

.desktop-icon .icon.face-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.desktop-icon .icon.pixel-icon {
    background: none;
    border-radius: 0;
    padding: 0;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.5));
}

.desktop-icon .icon.pixel-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    image-rendering: pixelated;
}

.msg-avatar-stack {
    display: none;
}

.msg-avatar-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: -10px;
    border: 2px solid #110B11;
}

.msg-avatar-stack .msg-avatar-circle:first-child {
    margin-left: 0;
}

.msg-avatar-overflow {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(249,248,248,0.15);
    border: 2px solid #110B11;
    margin-left: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-ui);
    font-size: 10px;
    color: rgba(249,248,248,0.6);
}

.portrait-icon {
    width: 44px;
    height: 44px;
    object-fit: contain;
    image-rendering: pixelated;
    margin-bottom: 2px;
    border-radius: var(--border-radius);
}

.desktop-icon .label {
    font-family: var(--font-ui);
    color: white;
    text-align: center;
    font-size: 13px;
    margin-top: 12px;
    max-width: 140px;
    letter-spacing: 0.5px;
    transition: color 0.15s ease;
}

.desktop-icon:hover .label {
    color: var(--accent);
}

.desktop-icon .meta-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    margin-top: 4px;
}
.desktop-icon .meta {
    font-family: var(--font-meta);
    color: rgba(226, 225, 225, 0.34);
    text-align: center;
    line-height: 1.4;
}
.desktop-icon .play-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 3px 11px;
    margin-top: 6px;
    border: 1px solid rgba(249,248,248, 0.28);
    border-radius: 999px;
    background: rgba(249,248,248, 0.05);
    color: rgba(249,248,248, 0.7);
    font-family: var(--font-ui);
    text-transform: uppercase;
    line-height: 1;
    pointer-events: none;
    transition: background 120ms, color 120ms, border-color 120ms;
}
.desktop-icon:hover .play-pill {
    background: rgba(249,248,248, 0.12);
    color: var(--text);
    border-color: rgba(249,248,248, 0.45);
}

/* Sticky vertical timeline navigator */
.timeline-nav {
    position: fixed;
    right: 22px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 0;
}
.timeline-nav-link {
    font-family: var(--font-ui);
    color: rgba(249,248,248,0.22);
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
    padding: 3px 0;
    text-align: right;
    line-height: 1;
    user-select: none;
}
.timeline-nav-link:hover {
    color: var(--accent);
}
.timeline-nav-link.active {
    color: var(--text);
}

/* Topic markers — invisible scroll anchors for the timeline navigator */
.band-banner {
    position: absolute;
    width: 1px;
    height: 1px;
    font-size: 0;
    color: transparent;
    pointer-events: none;
    user-select: none;
}

/* Image thumbnail desktop icon */
.desktop-icon .icon.img-thumb {
    width: 56px;
    height: 56px;
    border: 1px solid var(--border-strong);
    border-radius: var(--border-radius);
    overflow: hidden;
    background: var(--surface);
}

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

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(0,0,0,0.85);
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.lightbox.active {
    display: flex;
}

.lightbox img {
    max-width: 88vw;
    max-height: 88vh;
    object-fit: contain;
    border: 1px solid var(--border-strong);
    box-shadow: 0 32px 80px rgba(0,0,0,0.8);
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.icon-spin img {
    animation: spin-slow 6s linear infinite;
}

/* Chat icon with badge */
.desktop-icon .badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: var(--surface);
    color: var(--text-muted);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Click-catcher behind open windows (closes them on click). Blurs the whole
   desktop; the darkening/halo shaping comes from .flashlight-overlay below. */
.desktop-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: transparent;
    backdrop-filter: blur(10px) brightness(0.85);
    -webkit-backdrop-filter: blur(10px) brightness(0.85);
    z-index: 98;
    pointer-events: all;
}
.desktop-overlay.active { display: block; }

/* Flashlight: dark blurred veil over the desktop with a circular hole that
   follows the cursor. While a window is open it eases into a wide halo
   centered behind the window and the veil goes darker (window mode). */
.flashlight-overlay {
    position: fixed;
    inset: 0;
    --mx: 50vw;
    --my: 40vh;
    --r: 250px;
    background: rgba(8, 3, 5, 0.5);
    backdrop-filter: blur(11px) saturate(0.65) brightness(0.55);
    -webkit-backdrop-filter: blur(11px) saturate(0.65) brightness(0.55);
    mask-image: radial-gradient(circle var(--r) at var(--mx) var(--my), transparent 0%, transparent 32%, black 78%);
    -webkit-mask-image: radial-gradient(circle var(--r) at var(--mx) var(--my), transparent 0%, transparent 32%, black 78%);
    z-index: 90;
    pointer-events: none;
    transition: background-color 0.8s ease, opacity 2s ease;
}
.flashlight-overlay.flashlight-window-mode { background: rgba(4, 2, 3, 0.72); }
/* Page load: the whole desktop shows first; the veil settles in a few seconds later */
.flashlight-overlay.flashlight-intro { opacity: 0; }
/* Admin mode: no torch — you need to see the whole desktop to arrange it */
.admin-mode .flashlight-overlay { display: none; }

/* ── shared window chrome — one component, used by every window ── */
.window {
    background: rgba(17, 11, 17, 0.82);
    -webkit-backdrop-filter: blur(22px) saturate(1.1);
    backdrop-filter: blur(22px) saturate(1.1);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}

/* File viewer window */
.file-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 44%;
    height: 75%;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: 0 24px 60px rgba(0,0,0,0.7);
}

.file-window.hidden {
    display: none;
}

/* Character card (.png) window */
.card-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30%;
    height: 78%;
    z-index: 100;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.card-window.hidden { display: none; }

.card-body {
    flex: 1;
    display: grid;
    grid-template-columns: 1fr;
    min-height: 0;
}
.card-window.show-side {
    width: 64%;
}
.card-window.show-side .card-body {
    grid-template-columns: 1fr 500px;
}
/* Title-bar toggle: "comments" button */
/* Visuals come from the unified button system at the end of this file */
.card-side-toggle {
    white-space: nowrap;
    z-index: 2;
    margin-right: 6px;
}

.card-data-pane {
    padding: var(--padding);
    overflow-y: auto;
    min-height: 0;
    background-color: var(--bg);
}

.card-data-pane pre#cardJsonPretty {
    margin: 0;
    font-family: var(--font-code);
    line-height: 1.7;
    white-space: pre-wrap;
    color: var(--text);
    font-size: 13px;
}

.card-comments-pane {
    padding: var(--padding) var(--padding) 0;
    display: none; /* hidden by default — toggled on via .card-window.show-side */
    flex-direction: column;
    gap: 14px;
    font-family: var(--font-ui);
    color: var(--text);
    min-height: 0;
}
.card-window.show-side .card-comments-pane {
    display: flex;
}
.card-view-tabs {
    display: flex;
    gap: 6px;
}
.card-view-tab {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-family: var(--font-ui);
    padding: 4px 10px;
    cursor: pointer;
    border-radius: var(--border-radius);
    text-transform: lowercase;
    transition: all 0.15s ease;
}
.card-view-tab:hover { color: var(--text); border-color: var(--border-strong); }
.card-view-tab.active { color: var(--accent-soft); border-color: var(--accent-soft); }
.card-view-tab .tab-count { color: var(--text-faint); margin-left: 5px; }
.card-view-tab.active .tab-count { color: var(--text-muted); }

.card-view { display: none; flex: 1; min-height: 0; }
.card-view.active { display: flex; flex-direction: column; }

#cardCommentsView { overflow-y: auto; gap: 16px; padding-right: 4px; }
#cardCommentsList { display: flex; flex-direction: column; gap: 16px; }

.card-comments-pane .comments-header {
    color: var(--text-muted);
    text-transform: uppercase;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.card-comments-pane .comments-header .sort {
    color: var(--text-faint);
    text-transform: none;
}
.card-comment {
    display: flex;
    gap: 10px;
    padding-bottom: 4px;
    /* Comments grow in one by one like chat bubbles: quick scale from the
       avatar side with a decelerating ease, no bounce. Delay staggered
       inline by JS. */
    opacity: 0;
    transform-origin: 16px center;
    animation: comment-pop 0.3s cubic-bezier(0.05, 0.7, 0.1, 1) forwards;
}
@keyframes comment-pop {
    from { opacity: 0; transform: scale(0.9); }
    60%  { opacity: 1; }
    to   { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    .card-comment { animation: none; opacity: 1; transform: none; }
}
.card-comment:last-child { padding-bottom: 0; }
/* Unified avatar — used everywhere a username appears */
.avatar {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center;
    background: var(--bg);
    display: block;
}
.avatar.avatar-top { object-position: top; }
.comment-content {
    display: flex;
    flex-direction: column;
    gap: 5px;
    flex: 1;
    min-width: 0;
}
.comment-meta {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 16px;
    margin-bottom: 4px;
    font-family: var(--font-meta);
}
.comment-handle {
    color: var(--accent);
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 12px;
}
.comment-handle.op { color: var(--accent); }
.comment-time { color: var(--text-faint); font-family: var(--font-meta); }
/* Comment bodies use the same bubble treatment as chat messages (.msg-bubble) */
/* Comment bodies are chat bubbles — shared rule lives with .msg-bubble */
.comment-body {
    display: inline-block;
}
.comment-likes {
    color: var(--text-faint);
}
.comment-likes.hot { color: var(--accent); }

.reddit-card {
    width: 380px;
    padding: 16px 18px 14px;
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    background: var(--bg);
    cursor: pointer;
    color: var(--text-muted);
    font-family: var(--font-meta);
    font-size: var(--font-size);
    line-height: 1.5;
}
.reddit-card-meta { margin-bottom: 10px; }
.reddit-card-title {
    font-family: var(--font-ui);
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 10px;
}
.reddit-card-body {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}
.reddit-card-stats {
    display: flex;
    gap: 16px;
    margin-top: 14px;
}

/* OP / "bot request" original-poster comment — same bubble, with a small accent tag */
.card-comment.op .comment-handle { color: var(--accent); }
.op-tag {
    color: var(--text-faint);
    margin-left: 4px;
}
/* Rich content (h3 / paragraphs) inside any comment bubble */
.comment-body h3 {
    font-weight: 600;
    color: var(--accent);
    margin: 2px 0 8px 0;
}
.comment-body p {
    margin: 0 0 8px 0;
    line-height: 1.55;
}
.comment-body p:last-child { margin-bottom: 0; }
.comment-body strong { color: var(--text); }
.comment-body em { color: var(--text); }
/* Rich content inside a message bubble (e.g. bot-request OP title) — inherits the dark bubble text */
.msg-bubble h3 { font-weight: 700; margin: 2px 0 8px 0; }
.msg-bubble p { margin: 0 0 8px 0; }
.msg-bubble p:last-child { margin-bottom: 0; }
.card-data-pane .reveal-caption {
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.card-data-pane .reveal-caption .arrow { color: var(--accent); }
.card-data-pane .reveal-caption .step { color: var(--accent-soft); }
/* Voice memo mini-player — floats near the clicked icon */
.voice-memo-player {
    position: fixed;
    background: #191119;
    border-color: var(--border-strong);
    border-radius: var(--border-radius);
    padding: 8px 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-family: var(--font-ui);
    color: var(--text);
    width: 280px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.65);
    z-index: 70;
}
.voice-memo-player.docked {
    left: 40px !important;
    top: auto !important;
    bottom: 40px;
    transition: left 0.3s ease, bottom 0.3s ease;
}
.vm-captions {
    flex-basis: 100%;
    width: 100%;
    margin: 4px 0 0;
    padding: 8px 4px 2px;
    border-top: 1px solid rgba(249,248,248,0.12);
    font-family: var(--font-ui);
    font-size: 16px;
    line-height: 1.3;
    text-align: center;
    color: rgba(249,248,248,0.78);
    min-height: 18px;
    display: none;
}
.vm-captions.visible { display: block; }
.vm-qm {
    font-family: var(--font-ui);
    font-size: 1.6em;
    line-height: 0;
    vertical-align: -0.1em;
    margin: 0;
}
.voice-memo-player.hidden { display: none; }
.vm-play {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 1px solid var(--border-strong);
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}
.vm-play:hover { border-color: var(--text-muted); }
.vm-transcript {
    border: none;
    background: transparent;
    color: var(--text-faint);
    font-family: var(--font-ui);
    padding: 0 4px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    flex-shrink: 0;
}
.vm-transcript:hover { color: var(--text); }
.vm-progress {
    flex: 1;
    min-width: 0;
    height: 16px;
    display: flex;
    align-items: center;
    cursor: pointer;
}
.vm-progress::before {
    content: '';
    width: 100%;
    height: 3px;
    background: rgba(249,248,248,0.12);
    border-radius: 2px;
    position: relative;
}
.vm-progress {
    position: relative;
}
.vm-progress::before {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}
.vm-fill {
    height: 3px;
    background: var(--accent-soft);
    border-radius: 2px;
    width: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}
.vm-time {
    color: var(--text-faint);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.vm-close {
    background: none;
    border: none;
    color: var(--text-faint);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}
.vm-close:hover { color: var(--text); }

/* Inline bot-request post-it panel (no overlay, lives on the desktop canvas) */
/* The bot-request panel IS a .chat-float-window (same geometry/behavior);
   this class only carries its content-specific bits (see .bot-request-body). */
.bot-request-body { padding: var(--padding); }

/* Reference images attached to a comment — render inside the bubble */
.comment-body .comment-images,
.msg-bubble .comment-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 12px;
}
.comment-body .comment-images img,
.msg-bubble .comment-images img {
    width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    cursor: pointer;
    border: 1px solid var(--border);
    transition: transform 0.15s ease, border-color 0.15s ease;
    display: block;
}
.comment-body .comment-images img:hover,
.msg-bubble .comment-images img:hover {
    transform: scale(1.02);
    border-color: var(--border-strong);
}

/* Video window */
.video-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 62%;
    height: auto;
    max-height: 88vh;
    z-index: 100;
    background: #000;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.video-window.active { display: flex; }

.video-window video {
    width: 100%;
    display: block;
    background: #000;
}

/* Iframe window */
.iframe-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 46%;
    height: 80vh;
    z-index: 100;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.iframe-window.active {
    display: flex;
}

.iframe-window iframe {
    flex: 1;
    width: 100%;
    border: none;
    background: #fff;
}

.iframe-window .iframe-blocked {
    flex: 1;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    color: var(--text-faint);
    font-family: var(--font-ui);
}

.iframe-window .iframe-blocked.visible {
    display: flex;
}

/* Comments arrive as IM-style messages pinned to the bottom-right of the
   screen while the document stays centered. No window chrome — each comment
   is its own floating bubble, stacking upward as they land. */
.iframe-comments-panel {
    position: fixed;
    right: 24px;
    bottom: 24px;
    top: auto;
    left: auto;
    width: 340px;
    max-height: 70vh;
    z-index: 101;
    background: transparent;
    border: none;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-radius: 0;
    padding: 0;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    justify-content: flex-end;
    gap: 14px;
    font-family: var(--font-ui);
    color: var(--text);
}
.iframe-comments-panel.visible { display: flex; }
/* IM view: handle + bubble only (markup omits avatar/time/likes); no extra spacing */
.iframe-comments-panel .chat-message {
    margin-bottom: 0;
    padding-bottom: 0;
}
/* Animation handled by unified rule above. */

.iframe-open-tab {
    font-family: var(--font-ui);
    color: var(--text-faint);
    background: none;
    border: 1px solid var(--border-strong);
    border-radius: var(--border-radius);
    padding: 4px 10px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.iframe-open-tab:hover {
    color: var(--accent-soft);
    border-color: var(--accent-soft);
}

/* Window title bar — canonical: centered title, traffic lights pinned right */
.window-titlebar {
    position: relative;
    display: flex;
    align-items: center;
    height: 38px;
    padding: 0 var(--padding);
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
    user-select: none;
}

.window-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    color: var(--text-muted);
    pointer-events: none;
    white-space: nowrap;
}

.window-traffic-lights {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    gap: 8px;
    align-items: center;
    z-index: 1;
}

.traffic-light {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    transition: filter 0.12s;
}

.traffic-light:hover { filter: brightness(0.78); }

.traffic-close    { background: #FF5F57; }
.traffic-minimize { background: #FEBC2E; }
.traffic-maximize { background: #28C840; }

.window-titlebar-spacer { flex: 1; }

/* Window footer — path + status, shared across windows */
.window-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 40px;
    padding: 0 var(--padding);
    border-top: 1px solid var(--border);
    color: var(--text-faint);
    flex-shrink: 0;
}
.window-footer .footer-path,
.window-footer .footer-status {
    color: var(--text-faint);
    white-space: nowrap;
}
/* Card window footer holds the view toggles, left-aligned */
.card-footer {
    justify-content: flex-start;
    gap: 8px;
}

/* Document window */
.document-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40%;
    height: 70%;
    z-index: 100;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.document-window.active {
    display: flex;
}

.document-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--padding);
    color: var(--text-muted);
    line-height: 1.8;
}

.document-body h1 {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: normal;
    text-transform: none;
}

.document-body h2 {
    color: var(--text-muted);
    margin: 20px 0 10px 0;
    font-weight: normal;
    text-transform: none;
}

.document-body p {
    margin-bottom: 12px;
}

.document-body .diary-entry p {
    margin-bottom: 32px;
}
.document-body .diary-entry p:last-child {
    margin-bottom: 0;
}

.document-body ul {
    margin: 10px 0;
    padding-left: 16px;
    list-style: none;
}

.document-body li {
    margin-bottom: 6px;
}

.document-body li::before {
    content: '· ';
    color: var(--text-faint);
}

.document-body code {
    background: transparent;
    padding: 0;
    font-family: var(--font-code);
    color: var(--text-muted);
}

.document-body a {
    color: var(--text-muted);
    text-decoration: underline;
}

.document-body a:hover {
    color: var(--accent);
}

/* Folder window */
.folder-window {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 38%;
    height: auto;
    max-height: 82vh;
    z-index: 100;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.folder-window.active {
    display: flex;
}


.folder-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0;
}

/* List view header */
.folder-list-header {
    display: none;
}

/* List view */
.folder-list {
    display: flex;
    flex-direction: column;
    padding: var(--padding);
}

.folder-item {
    display: flex;
    align-items: center;
    padding: 4px 0;
    margin-bottom: 4px;
    cursor: pointer;
}

.folder-item:hover .item-name {
    color: var(--accent);
}

.folder-item .item-main {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.folder-item .item-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.folder-item .item-icon svg {
    width: 100%;
    height: 100%;
}

.folder-item .item-name {
    color: white;
    white-space: nowrap;
}

.folder-item .item-desc {
    color: var(--text-faint);
}

.folder-item .item-size,
.folder-item .item-date {
    font-family: var(--font-code);
    color: var(--text-faint);
}

.file-footer {
    padding: 8px var(--padding);
    border-top: 1px solid var(--border);
    color: var(--text-faint);
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.file-path {
    color: var(--text-muted);
    font-family: var(--font-code);
}

.file-path .highlight {
    color: var(--text-muted);
}

.file-meta {
    display: flex;
    gap: 20px;
    color: var(--text-faint);
}

.file-meta span {
    opacity: 0.7;
}

.file-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: var(--padding);
    position: relative;
    background: var(--bg);
}

#jsonContent {
    font-family: var(--font-code);
    line-height: 1.7;
    white-space: pre-wrap;
    color: var(--text);
}

.json-key { color: var(--text-muted); }
.json-string { color: var(--accent); }
.json-number { color: var(--accent); }
.json-bracket { color: var(--text-faint); }
.json-cursor {
    display: inline-block;
    width: 1px;
    height: 1em;
    background: var(--text-muted);
    margin-left: 1px;
    vertical-align: text-bottom;
    animation: cursor-blink 0.8s step-end infinite;
}
@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}



/* === RIGHT PANEL: CHAT === */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: var(--padding);
}

.chat-line {
    line-height: 1.5;
    padding: 2px 0;
}

.chat-name {
    color: var(--accent);
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

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

.typing-indicator-container {
    min-height: 28px;
    padding: 8px 16px 12px 16px;
    transition: all 0.2s ease;
}

.typing-indicator {
    color: var(--text);
    font-size: 13px;
}

.typing-dots {
    animation: blink 1s infinite;
}

/* Typing speed variations */
.typing-dots.fast {
    animation: blink 0.4s infinite;
}
.typing-dots.medium {
    animation: blink 0.7s infinite;
}
.typing-dots.slow {
    animation: blink 1.2s infinite;
}

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

/* Multiple typers */
.typing-indicator-line {
    display: block;
    margin-bottom: 2px;
}
.typing-indicator-line:last-child {
    margin-bottom: 0;
}

/* Scrollbar */
.file-body::-webkit-scrollbar,
.chat-messages::-webkit-scrollbar {
    width: 4px;
}
.file-body::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: var(--surface-high);
    border-radius: 2px;
}

/* Status bar for file viewer */
.status-bar {
    padding: 4px 12px;
    border-top: 1px solid var(--border);
    color: var(--text-faint);
    display: flex;
    justify-content: space-between;
}

/* Panel header for chat */
.panel-header {
    padding: 8px var(--padding);
    text-transform: lowercase;
    border-bottom: 1px solid var(--border);
    color: var(--text-faint);
    flex-shrink: 0;
}

/* Group chat header */
.group-chat-header {
    padding: 24px var(--padding);
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.avatar-cluster {
    position: relative;
    width: 180px;
    height: 100px;
    margin-bottom: 16px;
}

.avatar-cluster .avatar {
    position: absolute;
    border-radius: 50%;
    background: var(--surface-high);
    overflow: hidden;
    border: 2px solid var(--bg);
}

.avatar-cluster .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-cluster .avatar-center {
    width: 56px;
    height: 56px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 7;
}

.avatar-cluster .avatar-1 { width: 36px; height: 36px; top: 20px; left: 25px; z-index: 1; }
.avatar-cluster .avatar-2 { width: 40px; height: 40px; top: 0; left: 55px; z-index: 2; }
.avatar-cluster .avatar-3 { width: 36px; height: 36px; top: 0; right: 55px; z-index: 3; }
.avatar-cluster .avatar-4 { width: 40px; height: 40px; top: 18px; right: 25px; z-index: 4; }
.avatar-cluster .avatar-5 { width: 32px; height: 32px; bottom: 10px; left: 35px; z-index: 5; }
.avatar-cluster .avatar-6 { width: 32px; height: 32px; bottom: 10px; right: 35px; z-index: 6; }

.group-chat-title {
    color: var(--text);
    margin-bottom: 4px;
}

.group-chat-title .tm {
    color: var(--text);
    margin-left: 2px;
}

.group-chat-subtitle {
    color: var(--accent);
}

/* === CREATOR CHAT WINDOW === */
/* Transparent floating chat window — no background, no border, no titlebar */
.chat-float-window {
    position: fixed;
    /* Anchored where a full-height (620px) centered window's top edge sits,
       so the window grows downward as messages arrive instead of jittering
       around a moving center. Short chats simply end sooner. */
    top: max(7.5vh, calc(50% - 310px));
    left: 50%;
    transform: translateX(-50%);
    width: 480px;
    max-width: 90vw;
    height: auto;
    max-height: min(620px, 85vh);
    z-index: 100;
    display: none;
    flex-direction: column;
    overflow-y: auto;
    padding: 0;
    border-radius: var(--border-radius);
}

.chat-float-window.active {
    display: flex;
}

/* Sticky titlebar so the window stays the scroll container (matches .card-window chrome) */
.chat-float-window .window-titlebar {
    position: sticky;
    top: 0;
    background: rgba(17, 11, 17, 0.92);
    -webkit-backdrop-filter: blur(22px) saturate(1.1);
    backdrop-filter: blur(22px) saturate(1.1);
    z-index: 2;
}

/* Messages area — used inside .chat-float-window which handles scroll.
   No fixed height: the window fits its content up to the cap. */
.creator-messages {
    display: flex;
    flex-direction: column;
    min-height: 60px;
    padding: var(--padding) var(--padding) calc(var(--padding) + 12px);
}

/* === UNIFIED MESSAGE ENTER ANIMATION ===
   JS adds .visible to trigger; staggered per-item. */
.chat-message {
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.chat-message.visible {
    opacity: 1;
    transform: translateY(0);
}
.chat-message { margin-bottom: 20px; }

/* === SMS-style chat bubbles (chat pop-ups, bot chat, group chat) ===
   Alternating sides: .msg-left / .msg-right set by JS (first left, second right). */
.msg-left, .msg-right { display: flex; align-items: flex-end; gap: 8px; margin-bottom: 16px; }
.msg-left  { justify-content: flex-start; }
.msg-right { justify-content: flex-end; }
/* Profile pic sits at the outer edge, bottom-aligned with the bubble */
.msg-left .avatar, .msg-right .avatar {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
}
.msg-col { display: flex; flex-direction: column; max-width: 78%; min-width: 0; }
.msg-left  .msg-col { align-items: flex-start; }
.msg-right .msg-col { align-items: flex-end; }
.msg-handle {
    font-family: var(--font-ui);
    text-transform: uppercase;
    color: var(--accent);
    font-size: 12px;
    letter-spacing: 0.05em;
    margin: 0 0 8px;
    opacity: 0.9;
}
/* Scene narration / roleplay actions — rendered outside the bubble */
.msg-action {
    font-family: var(--font-ui-2);
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-muted);
    max-width: 100%;
    margin-bottom: 12px;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

/* The chat bubble — ONE component. Owns its own typography so containers
   can't leak differing line-heights/sizes into it. Comments reuse it. */
.msg-bubble,
.comment-body {
    background: var(--bubble);
    color: var(--bubble-text);
    font-family: var(--font-ui-2);
    font-size: 13px;
    line-height: 1.65;
    padding: 9px 14px;
    border-radius: var(--border-radius);
    word-wrap: break-word;
    overflow-wrap: anywhere;
    width: fit-content;
    max-width: 100%;
}
.msg-bubble { position: relative; }
/* Reactions */
.chat-reactions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.chat-reactions:has(.chat-reaction.visible) {
    margin-top: 6px;
}

.chat-reaction {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--surface-high);
    padding: 6px;
    border-radius: var(--border-radius);
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.3s, transform 0.3s;
}

.chat-reaction.visible {
    opacity: 1;
    transform: scale(1);
}

.chat-reaction-emoji {
}

.chat-reaction-count {
    color: var(--text-muted);
    font-family: var(--font-meta);
}

/* Timestamp divider */
.chat-divider {
    text-align: center;
    margin: 16px 0;
    color: var(--text-faint);
    font-family: var(--font-meta);
}

.chat-divider span::before {
    content: '-- ';
    color: var(--text-faint);
}

.chat-divider span::after {
    content: ' --';
    color: var(--text-faint);
}

/* Typing indicator */
.chat-typing {
    padding: 8px var(--padding);
    color: var(--text);
    min-height: 28px;
    text-align: center;
    font-family: var(--font-ui-2);
    margin-bottom: 8px;
}

.chat-float-window .chat-typing {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-typing .typing-cursor {
    animation: blink 1s infinite;
}

/* New messages indicator */
.new-messages-bar {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: transparent;
    color: var(--text-muted);
    padding: 6px 12px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.new-messages-bar::before {
    content: '[ ';
}

.new-messages-bar::after {
    content: ' ]';
}

.new-messages-bar.visible {
    opacity: 1;
    pointer-events: auto;
}

/* Face icons in folder */
.item-icon-face {
    border-radius: 50%;
    overflow: hidden;
}

.item-icon-face img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* === CHAT VIEW TOGGLE === */
.chat-view-tabs {
    display: none;
    border-bottom: 1px solid var(--border);
    padding: 0 8px;
}

.chat-view-tabs.visible {
    display: flex;
}

.chat-view-tab {
    padding: 10px 16px;
    color: var(--text-faint);
    cursor: pointer;
    border-bottom: 1px dashed transparent;
    transition: all 0.2s;
}

.chat-view-tab:hover {
    color: var(--text-muted);
}

.chat-view-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.chat-view-tab.hidden {
    display: none;
}

/* Hide inactive views */
.chat-view {
    display: none;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.chat-view.active {
    display: flex;
}

/* === 1:1 BOT CHAT VIEW === */
.bot-chat-header {
    display: none;
}

.bot-chat-avatar {
    display: none;
}

.bot-chat-avatar img {
    display: none;
}

.bot-chat-info {
    flex: 1;
}

.bot-chat-name {
    color: var(--accent);
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.bot-chat-status {
    color: var(--accent);
}

.bot-chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: var(--padding) var(--padding) 0;
}

.gc-typing {
    font-size: 10px;
    color: var(--text);
}


/* === GROUP CHAT — 2000s chat room style === */
.gc-window-title {
    font-family: var(--font-ui);
    font-size: 11px;
    color: var(--text-faint);
    text-transform: uppercase;
    border: 0.4px solid gray;
    padding: 11px;
    border-bottom: none;
}

.gc-member-count {
    color: var(--text-faint);
    margin-left: 4px;
}

.gc-chat-frame {
    position: relative;
    height: 530px;
}

#groupChatMessages {
    display: block;
    font-size: 14px;
    line-height: 1.6;
    padding: var(--padding) var(--padding) 40px;
    color: var(--text-muted);
    height: 100%;
    overflow-y: auto;
    box-sizing: border-box;
}

#groupChatTyping {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    text-align: center;
}

.gc-message {
    opacity: 0;
    transition: opacity 0.06s ease;
    word-break: break-word;
}

.gc-message.visible { opacity: 1; }

.gc-name { font-weight: bold; }

.gc-sep { color: var(--text-faint); margin-right: 3px; }

/* === TABLET STYLES === */
@media (min-width: 769px) and (max-width: 1024px) {
    .card-window {
        width: 50%;
    }
    /* With the comments pane open, the fixed 500px column would crush the
       JSON at this size — go near-full-width and split the panes evenly. */
    .card-window.show-side {
        width: 90%;
    }
    .card-window.show-side .card-body {
        grid-template-columns: 1fr 1fr;
    }
}

/* === MOBILE STYLES === */
@media (max-width: 768px) {
    :root { --padding: 12px; }   /* tighter interior inset on small screens */
    .split-container {
        padding: 12px;
        gap: 0;
    }

    /* Desktop takes full width */
    .desktop {
        flex: 1;
        width: 100%;
        position: relative;
    }

    .desktop-icon .icon {
        width: 40px;
        height: 40px;
    }

    .desktop-icon .label {
        max-width: 80px;
    }

    /* All windows become modals on mobile */
    .file-window,
    .document-window,
    .folder-window,
    .file-window {
        height: 70vh !important;
    }

    .file-window .window-titlebar,
    .document-window .window-titlebar,
    .folder-window .window-titlebar {
        padding: 12px var(--padding);
    }

    .traffic-light {
        width: 14px;
        height: 14px;
    }

    /* Document body padding */
    .document-body {
        padding: var(--padding);
    }

    /* Folder list adjustments */
    .folder-list-header {
        grid-template-columns: 1fr 60px;
    }

    .folder-list-header span:last-child {
        display: none;
    }



    /* Floating chat bubble */
    .mobile-chat-bubble {
        display: flex;
        position: fixed;
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
        background: #9B30FF;
        border-radius: 50%;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        z-index: 900;
        box-shadow: 0 4px 16px rgba(155, 48, 255, 0.4);
        transition: transform 0.2s, box-shadow 0.2s;
    }

    .mobile-chat-bubble:active {
        transform: scale(0.95);
    }

    .mobile-chat-bubble svg {
        width: 24px;
        height: 24px;
        fill: #fff;
    }

    .mobile-chat-bubble .bubble-badge {
        position: absolute;
        top: -4px;
        right: -4px;
        width: 18px;
        height: 18px;
        background: var(--surface);
        color: var(--text-muted);
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Mobile chat overlay - modal style */
    .mobile-chat-overlay {
        display: none;
        position: fixed;
        bottom: 90px;
        right: 16px;
        width: calc(100% - 32px);
        max-width: 360px;
        height: 70vh;
        max-height: 500px;
        background: var(--bg);
        border: 1px solid var(--border);
        border-radius: var(--border-radius);
        z-index: 1001;
        flex-direction: column;
        overflow: hidden;
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    }

    .mobile-chat-overlay.active {
        display: flex;
    }

    .mobile-chat-overlay .chat-view-tabs {
        border-bottom: 1px solid var(--border);
    }

    .mobile-chat-overlay .chat-view {
        flex: 1;
        overflow: hidden;
        display: none;
        flex-direction: column;
    }

    .mobile-chat-overlay .chat-view.active {
        display: flex;
    }

    .mobile-chat-overlay .group-chat-header {
        padding: var(--padding);
    }

    .mobile-chat-overlay .avatar-cluster {
        transform: scale(0.8);
    }

    /* === Mobile: keep the desktop layout, just make it scrollable === */
    html, body {
        overflow-x: auto !important;
        overflow-y: auto !important;
        height: auto !important;
        min-height: 100%;
    }
    .split-container {
        height: auto !important;
        min-height: 100vh;
        padding: 0 !important;
        gap: 0 !important;
    }
    .panel.desktop {
        flex: none;
        width: 100%;
        height: auto !important;
        min-height: 100vh;
        overflow: visible !important;
        border: none;
        position: relative;
    }
    /* Canvas adapts to viewport width — JS reflows icons into a narrower, taller scatter */
    .desktop-canvas {
        width: 100% !important;
        min-width: 0 !important;
    }

    /* Smaller labels/icons so the scatter still has breathing room at narrow widths */
    .desktop-icon .label { max-width: 100px; line-height: 1.3; }
    .desktop-icon .icon { width: 36px; height: 36px; }
    .desktop-icon .icon.img-thumb { width: 44px; height: 44px; }
    .desktop-icon .meta { }

    /* Modals: full-screen on phones */
    .card-window,
    .bot-request-panel,
    .document-window,
    .file-window,
    .folder-window {
        width: 100vw !important;
        height: 100vh !important;
        max-width: none !important;
        max-height: none !important;
        border-radius: 0 !important;
        border: none !important;
        top: 0 !important;
        left: 0 !important;
        transform: none !important;
        position: fixed !important;
    }
    .card-body {
        grid-template-columns: 1fr !important;
        grid-template-rows: minmax(40vh, 50vh) 1fr !important;
    }
    .card-data-pane {
        border-right: none !important;
        border-bottom: 1px solid var(--border);
    }
    /* Comments always visible below the code on phones — no toggle needed */
    .card-comments-pane {
        display: flex !important;
        padding-bottom: var(--padding);
    }
    .card-footer {
        display: none !important;
    }
    .bot-request-body {
        padding: 22px 20px !important;
    }
    .comment-body .comment-images {
        grid-template-columns: 1fr !important;
    }
    .document-body {
        padding: 28px 22px 60px !important;
    }
    .diary-entry {
        line-height: 1.65 !important;
    }
    .document-body .diary-entry p {
        margin-bottom: 22px !important;
    }
}

/* Hide mobile-only elements on desktop */
.mobile-only {
    display: none;
}

.mobile-chat-bubble {
    display: none;
}

#mobileChatOverlay.mobile-chat-overlay {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    bottom: auto;
    transform: translate(-50%, -50%);
    width: 380px;
    height: 560px;
    max-height: 85vh;
    border-color: var(--border);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
    z-index: 1002;
    flex-direction: column;
    overflow: hidden;
}

#mobileChatOverlay.mobile-chat-overlay.active {
    display: flex;
}

.mobile-chat-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(17, 11, 17, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 1001;
}

.mobile-chat-backdrop.active {
    display: block;
}

@media (max-width: 768px) {
    .mobile-only {
        display: flex;
    }
}

/* Windows stay fixed while desktop scrolls */
.file-window,
.document-window,
.folder-window { position: fixed; }

/* ======= DENSITY + VERDANA LAYER ======= */

:root {
    --border:        rgba(249,248,248,0.14);
    --border-strong: rgba(249,248,248,0.28);
}

/* All windows share the one unified border (var(--border)) from .window */

/* JSON viewer */
#jsonContent { line-height: 1.55; }
.file-body   { padding: 8px var(--padding); }
.file-footer { padding: 5px var(--padding); }
.file-meta   { }

/* Folder */
.folder-item            { padding: 2px 10px; }
.folder-item .item-name { font-family: var(--font-ui); }
.folder-item .item-size,
.folder-item .item-date { }
.folder-footer          { padding: 5px var(--padding); }

/* Group chat header */
.group-chat-header  { padding: 12px var(--padding); }
.group-chat-title   { }
.group-chat-subtitle{ }

/* Panel header */
.panel-header { padding: 5px var(--padding); }

/* Chat messages (right panel group chat) */
.chat-messages  { padding: 8px var(--padding); }
.chat-line      { }
.typing-indicator        { }
.typing-indicator-container { padding: 4px 10px 8px 10px; }

/* Creator chat */
.creator-chat-header              { padding: 6px var(--padding); }
.creator-chat-header .channel-title { font-family: var(--font-ui); }
.creator-chat-header .channel-desc  { font-family: var(--font-ui); }
.creator-chat-header .online-count  { }
.creator-messages     { padding: var(--padding) var(--padding) 22px; }
.chat-typing          { padding: 4px 12px; min-height: 22px; }

/* Status / misc */
.status-bar      { padding: 3px 10px; }
.new-messages-bar{ }

/* Bot posts (Discord image posts from char-requests) */
.msg-avatar-initial {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    flex-shrink: 0;
}
.msg-avatar-spacer {
    width: 42px;
    flex-shrink: 0;
}
.msg-tag {
    font-family: var(--font-ui);
    font-size: 9px;
    background: rgba(255,255,255,0.1);
    color: var(--text-muted);
    padding: 1px 4px;
    border-radius: var(--border-radius);
    margin-left: 4px;
    vertical-align: middle;
}
.bot-post-image-bubble {
    background: rgba(249,248,248, 0.06);
    border-radius: var(--border-radius);
    border-top-left-radius: 4px;
    overflow: hidden;
    display: inline-block;
    max-width: 240px;
}
.bot-post-image-bubble img {
    width: 100%;
    display: block;
    cursor: pointer;
}

/* Admin mode: draggable icons */
.admin-mode .desktop-icon { cursor: grab; }
.admin-mode .desktop-icon:active { cursor: grabbing; }

#adminToast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.92);
    color: #f9f8f8;
    font-family: var(--font-ui);
    font-size: 12px;
    padding: 6px 16px;
    border-radius: var(--border-radius);
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    white-space: nowrap;
}
#adminToast.visible { opacity: 1; }

/* No italics anywhere; <em>/<i> render upright */
em, i { font-style: normal; }

/* ===== Inbox — outgoing DMs, mostly unanswered ===== */
.inbox-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 720px;
    max-width: 92vw;
    height: 64vh;
    z-index: 100;
    display: none;
    flex-direction: column;
    overflow: hidden;
}
.inbox-window.active { display: flex; }
.inbox-body {
    flex: 1;
    display: flex;
    min-height: 0;
}
.inbox-list {
    width: 240px;
    flex-shrink: 0;
    border-right: 1px solid var(--border);
    overflow-y: auto;
    padding: 8px 0;
}
.inbox-row {
    padding: 10px var(--padding);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.inbox-row:hover { background: rgba(249, 248, 248, 0.03); }
.inbox-row.active { background: var(--surface); }
.inbox-user {
    font-family: var(--font-ui);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    display: flex;
    align-items: center;
    gap: 6px;
}
.inbox-unread-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    flex-shrink: 0;
}
.inbox-snippet {
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.inbox-snippet.unread { color: var(--text); }
.inbox-noreply { color: var(--text-faint); }
.inbox-user.muted { color: var(--text-muted); }
.inbox-time { color: var(--text-faint); font-size: 11px; }
.inbox-thread {
    flex: 1;
    overflow-y: auto;
    padding: var(--padding);
}
.inbox-msg-status {
    color: var(--text-faint);
    font-size: 11px;
    margin-top: 4px;
}

/* Floating hover preview for folder links (guide screenshots) */
#guidePreview {
    position: fixed;
    z-index: 300;
    display: none;
    pointer-events: none;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--border-radius);
    padding: 4px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.65);
}
#guidePreview img {
    display: block;
    width: 320px;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    object-position: top;
    border-radius: calc(var(--border-radius) - 3px);
}

/* ===== Buttons — one system ===== */
/* Secondary buttons: quiet outline, no raised shadow. Hover and the selected
   state (.active) go accent red — text and border only, no fill. */
.btn-secondary {
    background: var(--surface-high);
    color: var(--text-muted);
    border-radius: 4px;
    border: 0;
    border-radius: 0;
    font-family: var(--font-ui);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 6px 12px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-secondary:hover,
.btn-secondary.active {
    color: var(--accent);
    border-color: var(--accent);
    background: rgba(255, 46, 46, 0.06);
}

/* Quiet icon/text controls: muted at rest, accent red on hover */
.vm-play {
    box-shadow: 2px 2px 0 rgba(249, 248, 248, 0.32);
}
.vm-play:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}
.vm-play:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.vm-transcript:hover,
.vm-close:hover {
    color: var(--accent);
}
