:root {
    --color-magenta: #FF8AF7;
    --color-cyan:    #90F1EF;
    --color-lime:    #EAF000;
    --color-black:   #110B11;
    --color-white:   #F9F8F8;
}

@font-face {
    font-family: 'Flaco';
    src: url('/assets/fonts/flaco/flaco-regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'IBM Plex Mono';
    src: url('/assets/fonts/IBMPlexMono-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

a,
a:hover,
a:focus,
a:active,
a:visited {
    text-decoration: none;
}

:root {
    /* Brand palette */
    --yellow:  var(--color-lime);
    --pink:    var(--color-magenta);
    --black:   var(--color-black);
    --cyan:    var(--color-cyan);
    --white:   var(--color-white);

    /* Semantic roles */
    --bg:           #110B11;
    --surface:      #110B11;
    --surface-high: #110B11;
    --border:       rgba(249,248,248,0.07);
    --border-strong:rgba(249,248,248,0.15);
    --text:         #F9F8F8;
    --text-2:       rgba(249,248,248,0.50);
    --text-3:       rgba(249,248,248,0.25);
    --accent:       #FF8AF7;
    --accent-2:     #90F1EF;
    --accent-3:     #EAF000;
    --font-code:    'IBM Plex Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    --font-ui:      'Flaco', Verdana, Geneva, sans-serif;
    --font-lekton:  var(--font-ui);
    --font-serif:   var(--font-ui);

    /* Type scale */
    --type-heading-font: var(--font-ui);
    --type-body-font:    var(--font-ui);
    --type-code-font:    var(--font-code);

    --type-heading-size: 16px;
    --type-body-size:    14px;
    --type-micro-size:   9px;
    --type-quote-size:   16px;

    --type-heading-line: 1.4;
    --type-body-line:    1.6;
    --type-body-tight:   1.4;
    --type-body-loose:   1.85;
    --type-caption-line: 1;

    --type-heading-weight: 600;
    --type-body-weight:    400;
    --type-label-weight:   400;

    --type-heading-tracking: 0.03em;
    --type-body-tracking:    0;
    --type-meta-tracking:    0.02em;
    --type-ui-tracking:      0.04em;
    --type-status-tracking:  0.08em;
  
    --type-label-tracking:   0.18em;
    --type-button-tracking:  0;

    --font-size: var(--type-body-size);
    --home-chat-height: 420px;
    --home-chat-header-height: 32px;
    --control-radius: 12px;
}


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

::selection {
    background: var(--pink);
    color: var(--yellow);
}

html, body {
    width: 100%;
    height: auto;
    background: var(--bg);
    overflow-y: auto;
    overflow-x: hidden;
    font-family: var(--type-body-font);
    font-size: var(--type-body-size);
    font-weight: var(--type-body-weight);
    -webkit-font-smoothing: antialiased;
    margin: 0;
    padding: 0;
    color: var(--text);
}

body.modal-open {
    position: fixed;
    width: 100%;
    overflow: hidden !important;
}

input, button, textarea, select {
    font-size: inherit;
    font-family: inherit;
    border-radius: var(--control-radius);
}

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

.page-wrap {
    width: 50%;
    margin: 24px auto 0;
}

@media (min-width: 581px) and (max-width: 1024px) {
    .page-wrap {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .page-wrap {
        width: 100%;
        margin: 0;
    }
}

/* === LEFT PANEL: DESKTOP === */
.desktop {
    flex: 1;
    width: 100%;
    min-width: 0;
    background: var(--bg);
    position: relative;
    border: none;
    overflow-y: visible;
    overflow-x: hidden;
    height: auto;
    min-height: 0;
    scrollbar-width: none;
    scrollbar-gutter: auto;
}
.desktop::-webkit-scrollbar { display: none; width: 0; height: 0; }

.desktop-canvas {
    position: relative;
    width: 100%;
    overflow-y: visible;
    overflow-x: hidden;
    scrollbar-width: none;
    scrollbar-gutter: auto;
}
.desktop-canvas::-webkit-scrollbar { display: none; width: 0; height: 0; }

.band-grid-wrap {
    width: 100%;
    border: 1px solid rgba(255, 138, 247, 0.42);
    border-top: 0;
    scrollbar-width: none;
    scrollbar-gutter: auto;
}
.band-grid-wrap::-webkit-scrollbar { display: none; width: 0; height: 0; }

.band-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: auto;
    justify-items: center;
    justify-content: center;
}

.band-grid > * {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-right: 1px solid rgba(255, 138, 247, 0.2);
    border-bottom: 1px solid rgba(255, 138, 247, 0.2);
    padding: 24px 16px;
}

.ext-link-icon {
    display: inline-block;
    vertical-align: middle;
    margin-left: 4px;
    opacity: 0.6;
    flex-shrink: 0;
}

.guide-grid-frame {
    grid-column: 1 / -1;
    aspect-ratio: 16 / 9;
    align-items: stretch;
    justify-content: stretch;
    padding: 92px 116px;
    background: #000;
}

.guide-grid-board {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.guide-grid-title {
    display: none;
    font-family: var(--type-heading-font);
    font-size: clamp(28px, 4.6vw, 72px);
    line-height: 1;
    color: var(--white);
    letter-spacing: 0;
    text-align: center;
}

.guide-grid-cards {
    width: min(100%, 1420px);
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    grid-auto-rows: auto;
    gap: 84px 74px;
    align-items: start;
    justify-items: center;
}

.guide-card {
    display: grid;
    grid-template-rows: auto auto auto;
    align-items: center;
    justify-items: center;
    align-content: center;
    gap: 28px;
    min-width: 0;
    width: min(100%, 240px);
    padding: 0;
    border: 0;
    background: #000;
    color: var(--white);
    text-decoration: none;
    overflow: hidden;
    transition: border-color 0.15s ease, background 0.15s ease;
    grid-column: span 2;
}

.guide-card:hover {
    background: #000;
}

.guide-card-icon {
    width: clamp(46px, 5.2vw, 96px);
    aspect-ratio: 0.92;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #f9f8f8;
    border: 1px solid rgb(45, 45, 45);
    border-radius: var(--control-radius);
}

.guide-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
}

.guide-card-name {
    min-width: 0;
    font-family: var(--type-heading-font);
    font-size: clamp(25px, 2.85vw, 52px);
    line-height: 1.12;
    letter-spacing: 0;
    text-align: center;
    overflow-wrap: anywhere;
}

.guide-card-desc {
    font-family: var(--type-body-font);
    font-size: clamp(16px, 1.45vw, 24px);
    line-height: var(--type-body-tight);
    color: var(--pink);
    text-align: center;
}

@media (max-width: 768px) {
    .guide-grid-frame {
        aspect-ratio: auto;
        min-height: 720px;
        padding: 48px 24px;
    }

    .guide-grid-board {
        gap: 0;
    }

    .guide-grid-cards {
        grid-template-columns: 1fr;
        gap: 52px;
    }

    .guide-card {
        gap: 18px;
        padding: 0;
        grid-column: auto;
        width: min(100%, 240px);
    }

    .guide-card-name {
        font-size: 20px;
        line-height: 1;
    }
}

.desktop-icon.char-json .label {
    word-break: break-all;
}

.voice-memo-player.vm-inline {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: auto;
    width: 100%;
    border-radius: var(--control-radius);
    box-shadow: none;
    z-index: 1;
}

/* Desktop icons - plaintext style */
.desktop-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    cursor: pointer;
    user-select: none;
    letter-spacing: var(--type-body-tracking);
}

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

.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: 4px;
}

.desktop-icon .icon.pixel-icon {
    background: none;
    border-radius: 4px;
    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(--type-body-font);
    font-size: var(--type-body-size);
    color: rgba(249,248,248,0.6);
}

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

.desktop-icon .label {
    font-family: var(--type-heading-font);
    font-size: var(--type-body-size);
    color: var(--white);
    text-align: center;
    max-width: 180px;
    width: 100%;
    line-height: var(--type-heading-line);
    letter-spacing: var(--type-heading-tracking);
    text-transform: none;
    margin-top: 10px;
    word-break: normal;
    overflow-wrap: break-word;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
    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(--type-body-font);
    font-size: var(--type-body-size);
    color: #ff8af7;
    text-align: center;
    line-height: var(--type-body-tight);
    margin-top: 4px;
    text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}
.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(--type-code-font);
    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);
}


/* 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;
    overflow: hidden;
    background: var(--surface);
    border-radius: 4px;
}

.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);
    border-radius: 4px;
    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-2);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Desktop blur overlay */
.desktop-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 98;
    pointer-events: all;
}
.desktop-overlay.active { display: block; }

/* ── shared window chrome ── */
.window {
    background: var(--bg);
    border-radius: 4px;
    border: 1px solid rgb(73 73 73 / 42%);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
    color: var(--text-2);
    font-family: var(--type-body-font);
}

/* 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: 35%;
    height: 60%;
    z-index: 100;
    border-color: rgba(255,138,247,0.32);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.card-window.hidden { display: none; }

.card-window.chat-only .card-data-pane { display: none; }
.card-window.chat-only .card-body { grid-template-columns: 1fr; }
.card-window.chat-only .card-comments-pane { display: flex; }
.card-tabbar {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    border-bottom: 1px solid rgb(73 73 73 / 42%);
    flex-shrink: 0;
}
.card-window.chat-only [data-view="chat"] { display: none; }
.card-window.chat-only.show-side { width: 20%; }
.card-window.chat-only.show-side .card-body { grid-template-columns: 1fr; }

.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 340px;
}
/* Title-bar toggles: "comments" / "chat with bot" buttons */
.card-side-toggle {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-2);
    font-family: var(--type-body-font);
    letter-spacing: var(--type-button-tracking);
    padding: 5px 10px;
    border-radius: var(--control-radius);
    cursor: pointer;
    transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
    line-height: var(--type-caption-line);
    white-space: nowrap;
    z-index: 2;
    margin-right: 6px;
}
.card-side-toggle:hover {
    color: var(--text);
    border-color: var(--border-strong);
}
.card-side-toggle.active {
    color: var(--text);
    border-color: var(--border-strong);
    background: var(--surface);
}

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

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

.card-comments-pane {
    padding: 24px;
    display: none; /* hidden by default — toggled on via .card-window.show-side */
    flex-direction: column;
    gap: 14px;
    font-family: var(--type-body-font);
    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-2);
    font-family: var(--type-body-font);
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 4px;
    text-transform: lowercase;
    letter-spacing: var(--type-ui-tracking);
    transition: all 0.15s ease;
}
.card-view-tab:hover { color: var(--text); border-color: var(--border-strong); }
.card-view-tab.active { color: var(--accent-2); border-color: var(--accent-2); }
.card-view-tab .tab-count { color: var(--text-3); margin-left: 5px; }
.card-view-tab.active .tab-count { color: var(--text-2); }

.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; }

#cardChatView { gap: 0; }
.chat-context {
    display: none;
}

#cardChatMessages {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-right: 4px;
    margin-bottom: 8px;
}
#cardChatMessages .chat-message {
    transform: none;
    transition: opacity 0.5s ease;
}
#cardChatTyping {
    color: var(--text-3);
    min-height: 14px;
    margin-bottom: 6px;
}
.card-chat-input-wrap {
    padding-top: 10px;
}
#cardChatInput {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 12px;
    font-family: var(--type-body-font);
    font-size: var(--type-heading-size);
    border-radius: 4px;
    outline: none;
}
#cardChatInput:focus { border-color: var(--accent-2); }
#cardChatInput::placeholder { color: var(--text-3); }
.card-comments-pane .comments-header {
    color: var(--text-2);
    letter-spacing: var(--type-label-tracking);
    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-3);
    text-transform: none;
    letter-spacing: var(--type-body-tracking);
}
.card-comment {
    display: flex;
    gap: 10px;
}

.chat-message.card-comment {
    --message-accent: var(--accent);
    position: relative;
    padding: 0;
    border-radius: var(--control-radius);
    background: none;
    border-left: 0;
    align-items: flex-start;
}

.chat-message.card-comment::before {
    content: none;
}

.chat-message.card-comment.typing-active {
    background: none;
    box-shadow: none;
}

.chat-message .comment-content {
    max-width: 100%;
}

.chat-message .comment-body {
    display: block;
    width: auto;
    max-width: 100%;
    padding: 0;
    border-radius: 0;
    background: none;
    box-shadow: none;
}

.chat-message.typing-active .comment-body {
    background: none;
    box-shadow: none;
}

.chat-message.card-comment:nth-child(7n+1) { --message-accent: #ff4fd8; }
.chat-message.card-comment:nth-child(7n+2) { --message-accent: #00f5ff; }
.chat-message.card-comment:nth-child(7n+3) { --message-accent: #eaff00; }
.chat-message.card-comment:nth-child(7n+4) { --message-accent: #7cff6b; }
.chat-message.card-comment:nth-child(7n+5) { --message-accent: #ff9f1c; }
.chat-message.card-comment:nth-child(7n+6) { --message-accent: #a78bfa; }
.chat-message.card-comment:nth-child(7n) { --message-accent: #ff5f57; }

#cardCommentsList .card-comment {
    opacity: 0;
    transition: opacity 0.5s ease;
}
#cardCommentsList .card-comment.visible {
    opacity: 1;
}
/* 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;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 2px;
    font-family: var(--type-body-font);
}
.comment-handle {
    color: var(--accent-2);
    font-family: var(--type-heading-font);
    font-size: var(--type-body-size);
    font-weight: var(--type-heading-weight);
    letter-spacing: var(--type-meta-tracking);
}
.comment-handle.op { color: var(--pink); }
.comment-time { display: none; }
.comment-body {
    color: rgba(249, 248, 248, 0.75);
    background: none;
    padding: 0;
    border-radius: 0;
    display: block;
    max-width: 100%;
    font-size: var(--type-heading-size);
    line-height: var(--type-body-line);
    word-wrap: break-word;
    font-family: var(--type-body-font);
}
.comment-likes { display: none; }

/* Cycle username colors across messages */
.card-comment:nth-child(3n+1) .comment-handle { color: var(--accent); }
.card-comment:nth-child(3n+2) .comment-handle { color: var(--accent-2); }
.card-comment:nth-child(3n+3) .comment-handle { color: var(--accent-3); }

.reddit-card {
    width: 350px;
    padding: 16px 18px 14px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    cursor: pointer;
    color: var(--text-2);
    font-family: var(--type-body-font);
    font-size: var(--type-body-size);
    line-height: var(--type-body-line);
}
.reddit-card-meta { margin-bottom: 10px; }
.reddit-card-title {
    font-family: var(--type-heading-font);
    font-weight: var(--type-heading-weight);
    line-height: var(--type-heading-line);
    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-3);
    margin-left: 4px;
}
/* Rich content (h3 / paragraphs) inside any comment bubble */
.comment-body h3 {
    font-size: var(--type-body-size);
    font-weight: var(--type-heading-weight);
    line-height: var(--type-heading-line);
    color: var(--accent);
    margin: 2px 0 8px 0;
}
.comment-body p {
    margin: 0 0 8px 0;
    line-height: var(--type-body-line);
}
.comment-body p:last-child { margin-bottom: 0; }
.comment-body strong { color: var(--text); }
.comment-body em { color: var(--text); }
.card-data-pane .reveal-caption {
    color: var(--text-2);
    letter-spacing: var(--type-label-tracking);
    text-transform: uppercase;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.card-data-pane .reveal-caption .arrow { color: var(--pink); }
.card-data-pane .reveal-caption .step { color: var(--accent-2); }
/* Voice memo mini-player — floats near the clicked icon */
.voice-memo-player {
    position: fixed;
    background: #191119;
    border-color: rgba(255, 138, 247, 0.42);
    border-radius: 0;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-family: var(--type-body-font);
    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(--type-body-font);
    font-size: var(--type-heading-size);
    line-height: var(--type-heading-line);
    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(--type-heading-font);
    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-2); }
.vm-transcript {
    border: none;
    background: transparent;
    color: var(--text-3);
    font-family: var(--type-body-font);
    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;
    position: relative;
}
.vm-progress::before {
    content: '';
    width: 100%;
    height: 3px;
    background: rgba(249,248,248,0.12);
    border-radius: 2px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}
.vm-fill {
    height: 3px;
    background: var(--accent-2);
    border-radius: 2px;
    width: 0;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}
.vm-time {
    color: var(--text-3);
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
}
.vm-close {
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    line-height: 1;
}
.vm-close:hover { color: var(--text); }

/* Shared centered message card */
.message-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 380px;
    max-width: 90vw;
    height: 500px;
    max-height: 85vh;
    overflow-y: auto;
    background: var(--bg);
    border-radius: 4px;
    padding: 0;
    font-family: var(--type-body-font);
    color: var(--text-2);
    line-height: var(--type-body-line);
    z-index: 100;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.message-panel .card-comment + .card-comment {
    margin-top: 16px;
}

.bot-request-panel.open {
    display: flex;
}

.message-panel-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* Reference images attached to a comment — render inside the bubble */
.comment-body .comment-images {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
    margin-top: 12px;
}
.comment-body .comment-images img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    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 {
    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;
    border-color: rgba(234,240,0,0.28);
    display: none;
    flex-direction: column;
    overflow: hidden;
}

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

.video-window .window-titlebar {
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.video-window .window-title {
    color: rgba(255,255,255,0.35);
}

.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;
    border-color: rgba(144,241,239,0.30);
    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-3);
    font-family: var(--type-body-font);
}

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

/* When the PDF carries comments, shift the iframe-window left so that
   the (PDF + comments) pair reads as one centered unit. The shift is
   half of (comments width + gap) = (24% + 1%)/2 = 12.5vw. */
.iframe-window.with-comments {
    transform: translate(calc(-50% - 12.5vw), -50%);
}
/* Comments panel that appears next to the iframe-window when a PDF carries comments */
.iframe-comments-panel {
    position: fixed;
    top: 10vh;
    left: 61.5%;
    width: 24%;
    max-height: 80vh;
    z-index: 100;
    border-color: var(--border-strong);
    padding: 18px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    gap: 14px;
    font-family: var(--type-body-font);
    color: var(--text);
}
.iframe-comments-panel.visible { display: flex; }
/* Animation handled by unified rule above. */

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

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

/* Window title bar */
.window-titlebar {
    display: flex;
    align-items: center;
    padding: 0 10px;
    height: 36px;
    background: rgba(255, 138, 247, 0.07);
    border-bottom: 1px solid rgb(73 73 73 / 42%);
    flex-shrink: 0;
    position: relative;
    user-select: none;
}

.window-traffic-lights {
    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-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--type-heading-font);
    font-size: var(--type-body-size);
    color: rgb(144 144 144 / 70%);
    pointer-events: none;
    white-space: nowrap;
}

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

.window-path-bar {
    flex-shrink: 0;
    padding: 5px 12px;
    font-family: var(--type-code-font);
    font-size: var(--type-body-size);
    color: rgb(144 144 144 / 55%);
    border-top: 1px solid rgb(73 73 73 / 42%);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
}

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

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

.info-window {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(620px, calc(100vw - 32px));
    height: min(72dvh, 640px);
    z-index: 100;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 138, 247, 0.42);
}

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

.info-window-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
}

.document-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px;
    color: var(--text-2);
    font-family: var(--type-body-font);
    font-size: var(--type-body-size);
    line-height: var(--type-body-loose);
}

.found-bot-line {
    font-family: var(--type-code-font);
    font-size: var(--type-heading-size);
    color: var(--text-2);
    line-height: var(--type-body-loose);
}
.found-bot-link {
    cursor: pointer;
    color: var(--text);
}
.found-bot-link:hover {
    color: var(--accent);
}

.document-body h1 {
    font-family: var(--type-heading-font);
    font-size: var(--type-heading-size);
    line-height: var(--type-heading-line);
    color: var(--text-2);
    margin-bottom: 16px;
    font-weight: var(--type-label-weight);
    text-transform: none;
    letter-spacing: var(--type-heading-tracking);
}

.document-body h2 {
    font-family: var(--type-heading-font);
    font-size: var(--type-body-size);
    line-height: var(--type-heading-line);
    color: var(--text-2);
    margin: 20px 0 10px 0;
    font-weight: var(--type-label-weight);
    text-transform: none;
    letter-spacing: var(--type-heading-tracking);
}

.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-3);
}

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

.document-body a {
    color: var(--text-2);
    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: 8px 0;
}

.folder-item {
    display: flex;
    align-items: center;
    padding: 4px 16px;
    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: var(--text-2);
    letter-spacing: var(--type-body-tracking);
    white-space: nowrap;
}

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

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

/* Folder footer */
.folder-footer {
    display: flex;
    justify-content: space-between;
    padding: 8px 16px;
    border-top: 1px solid var(--border);
    color: var(--text-3);
}

.folder-path {
    color: var(--text-3);
}

.folder-status {
    color: var(--text-3);
}

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

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

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

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

.file-meta span {
    opacity: 0.7;
}

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

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

.json-key { color: var(--text-2); }
.json-string { color: var(--cyan); }
.json-number { color: var(--yellow); }
.json-bracket { color: var(--text-3); }
.json-cursor {
    display: inline-block;
    width: 1px;
    height: 1em;
    background: var(--text-2);
    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: 12px 16px;
}

.chat-line {
    line-height: var(--type-body-line);
    padding: 2px 0;
}

.chat-name { color: var(--accent); }
.chat-name.victoria { color: var(--cyan); }
.chat-name.chloe { color: var(--text-3); }
.chat-name.eleanor { color: var(--cyan); }
.chat-name.logan { color: var(--cyan); }
.chat-name.priest { color: var(--pink); }
.chat-name.minho { color: var(--pink); }
.chat-name.luna { color: var(--text-3); }

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

.typing-indicator-container {
    font-family: var(--type-body-font);
    font-size: var(--type-body-size);
}

.typing-indicator {
    color: var(--text-2);
    font-family: var(--type-body-font);
    font-size: var(--type-body-size);
}

@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-3);
    display: flex;
    justify-content: space-between;
}

/* Panel header for chat */
.panel-header {
    padding: 8px 16px;
    text-transform: lowercase;
    letter-spacing: var(--type-heading-tracking);
    border-bottom: 1px solid var(--border);
    color: var(--text-3);
    flex-shrink: 0;
}

/* Group chat header */
.group-chat-header {
    padding: 24px 16px;
    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 === */
.chat-float-window {
    background: var(--bg);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 350px;
    max-width: 90vw;
    height: 500px;
    z-index: 100;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

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

#msgCardWindow.message-panel {
    width: 350px;
    max-width: 90vw;
    height: 500px;
    max-height: 85vh;
    padding: 0;
    overflow: hidden;
    border-radius: 4px;
}

#msgCardWindow.message-panel.active {
    display: flex;
}

#msgCardWindow.message-panel .creator-messages {
    flex: 1;
    display: block;
    overflow-y: auto;
    padding: 20px;
}

#msgCardWindow.message-panel .chat-message {
    margin-bottom: 0;
}

#msgCardWindow.message-panel .chat-typing {
    min-height: 0;
}

#msgCardWindow.short-message-panel {
    height: auto;
    min-height: 0;
    max-height: min(500px, 85vh);
}

#msgCardWindow.short-message-panel .creator-messages {
    flex: none;
    max-height: calc(85vh - 76px);
    overflow-y: auto;
}

#msgCardWindow.short-message-panel .chat-typing:empty {
    display: none;
}

.chat-float-close {
    position: fixed;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: 1px solid rgba(255, 138, 247, 0.2);
    border-radius: var(--control-radius);
    padding: 7px 14px;
    color: var(--text-2);
    font-family: var(--type-body-font);
    font-size: var(--type-body-size);
    letter-spacing: var(--type-label-tracking);
    text-transform: lowercase;
    cursor: pointer;
    line-height: var(--type-caption-line);
    transition: color 0.15s;
    z-index: 9999;
}

.chat-float-close::before {
    content: 'back to archive';
}

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

@media (max-width: 768px) {
    .chat-float-close {
        top: 0;
        right: 0;
        z-index: 10002;
    }
}



/* Messages area — used inside .chat-float-window which handles scroll */
.creator-messages {
    display: flex;
    flex-direction: column;
}

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

/* Reactions */
.chat-reactions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.chat-reactions {
    margin-top: 6px;
}

.chat-reaction {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(249, 248, 248, 0.055);
    border: 1px solid rgba(249, 248, 248, 0.08);
    color: var(--text);
    padding: 5px 8px;
    border-radius: 999px;
    opacity: 0;
    transform: translateY(4px) scale(0.92);
    transition: opacity 0.24s ease, transform 0.24s ease, background 0.24s ease, border-color 0.24s ease;
}

.chat-reaction.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
    background: rgba(249, 248, 248, 0.11);
    border-color: rgba(249, 248, 248, 0.18);
}

.chat-reaction-emoji {
}

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

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

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

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

/* Typing indicator */
.chat-typing {
    color: var(--text-3);
    font-family: var(--type-body-font);
    font-size: var(--type-body-size);
}

.chat-float-window .creator-messages {
    flex: 1;
    overflow-y: auto;
}

.chat-float-window .chat-typing {
    flex-shrink: 0;
}

.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-2);
    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-3);
    cursor: pointer;
    border-bottom: 1px dashed transparent;
    transition: all 0.2s;
}

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

.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(--text);
    margin-bottom: 2px;
}

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

.bot-chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px 16px 0 16px;
}

.gc-typing {
    font-size: var(--type-body-size);
    color: var(--text-3);
    font-family: var(--type-body-font);
}


/* === GROUP CHAT — 2000s chat room style === */
.gc-window-title {
    font-family: var(--type-heading-font);
    font-size: var(--type-body-size);
    color: rgba(255, 138, 247, 0.7);
    text-transform: uppercase;
    letter-spacing: var(--type-label-tracking);
    background: rgba(255, 138, 247, 0.07);
    border: 1px solid rgba(255, 138, 247, 0.2);
    padding: 6px 10px;
    border-bottom: none;
}

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

.gc-chat-frame {
    position: relative;
    flex: 1;
    overflow-y: auto;
    border: none;
    padding: 20px;
}

#groupChatMessages {
    display: block;
    font-size: var(--type-body-size);
    line-height: var(--type-body-line);
    padding: 0;
    color: var(--text-2);
    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;
    margin: 0;
    padding: 0;
    word-break: break-word;
    margin-bottom: 12px;
}

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

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

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

.bot-chat-input-area {
    padding: 0 16px 16px 16px;
}

.bot-chat-input-wrapper {
    display: flex;
    gap: 8px;
    align-items: center;
}


.bot-chat-input {
    flex: 1;
    background: transparent;
    border: 1px solid var(--border-strong);
    border-radius: var(--control-radius);
    padding: 6px;
    color: var(--text);
    outline: none;
}

.bot-chat-input::placeholder {
    color: var(--text-3);
}

.bot-chat-input:focus {
    border-color: var(--text-3);
}

.bot-chat-send {
    background: #fff;
    color: #000;
    border: none;
    cursor: pointer;
    padding: 6px 12px;
}

.bot-chat-send:hover {
    background: #ddd;
}

.bot-chat-send svg {
    display: none;
}

/* Empty state */
.bot-chat-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    text-align: center;
    padding: 40px;
}

.bot-chat-empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    opacity: 0.3;
}

/* === MOBILE STYLES === */
@media (max-width: 768px) {
    /* Desktop takes full width */
    .desktop {
        flex: none;
        width: 100%;
        position: relative;
        height: auto;
        overflow-x: hidden;
        overflow-y: visible;
    }

    .file-window .window-titlebar,
    .document-window .window-titlebar,
    .folder-window .window-titlebar {
        padding: 12px 16px;
    }

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

    /* Document body padding */
    .document-body {
        padding: 16px;
    }

    /* 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-2);
        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: 12px;
        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: 16px;
    }

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

    /* === Mobile: grid layout, no horizontal scroll === */
    html, body {
        overflow-x: hidden !important;
        overflow-y: auto !important;
        height: auto !important;
        min-height: 100%;
    }
    .desktop {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 100vh;
        overflow-x: hidden !important;
        overflow-y: auto !important;
    }
    .desktop-canvas {
        width: 100% !important;
        min-width: 0 !important;
        overflow-x: hidden !important;
    }
    .band-grid {
        width: 100%;
        box-sizing: border-box;
    }

    /* Compact icons/labels for grid cells at mobile sizes */
    .band-grid .desktop-icon .label { font-size: var(--type-body-size); max-width: 120px; line-height: var(--type-heading-line); margin-top: 6px; }
    .desktop-icon .icon { width: 44px; height: 44px; }
    .desktop-icon .icon.img-thumb { width: 44px; height: 44px; }
    .band-grid .desktop-icon .meta { font-size: var(--type-body-size); }

    /* Modals: centered on phones */
    .card-window,
    .message-panel,
    .document-window,
    .info-window,
    .file-window,
    .folder-window,
    .video-window,
    .iframe-window {
        width: calc(100vw - 24px) !important;
        max-width: 430px !important;
        max-height: 82dvh !important;
        border-radius: 4px !important;
        border: 1px solid rgba(255, 138, 247, 0.42) !important;
        top: 50% !important;
        left: 50% !important;
        transform: translate(-50%, -50%) !important;
        position: fixed !important;
    }
    .card-window,
    .document-window,
    .info-window,
    .file-window,
    .folder-window,
    .iframe-window {
        height: min(70dvh, 620px) !important;
    }
    .video-window {
        height: auto !important;
    }

    /* The PDF+comments side-by-side layout doesn't work on a phone — hide the panel */
    .iframe-comments-panel { display: none !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);
    }
    .message-panel {
        height: auto !important;
        padding: 0 !important;
    }
    .comment-body .comment-images {
        grid-template-columns: 1fr !important;
    }
    .document-body {
        padding: 28px 22px 60px !important;
    }
    .diary-entry {
        line-height: var(--type-body-line) !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);
}

/* Accent-colored window borders */
.mobile-chat-overlay  { border-color: rgba(255, 138, 247, 0.42); }

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

/* Folder */
.folder-item            { padding: 2px 10px; }
.folder-item .item-name { font-family: var(--type-body-font); font-size: var(--type-body-size); }
.folder-item .item-desc { font-family: var(--type-body-font); font-size: var(--type-body-size); color: rgba(144,241,239,0.55); }
.folder-footer          { padding: 5px 12px; }

/* Group chat header */
.group-chat-header  { padding: 12px 16px; }

/* Panel header */
.panel-header { padding: 5px 12px; }

/* Chat messages (right panel group chat) */
.chat-messages  { padding: 8px 10px; }

/* Creator chat */
.creator-chat-header              { padding: 6px 12px; }
.creator-chat-header .channel-title { font-family: var(--type-heading-font); }
.creator-chat-header .channel-desc  { font-family: var(--type-body-font); }
.creator-messages     { padding: 20px; }

/* Bot chat */
.bot-chat-messages   { padding: 10px 12px 0 12px; }
.bot-chat-input-area { padding: 0 12px 10px 12px; }
.bot-chat-input      { padding: 5px 8px; }
.bot-chat-send       { font-family: var(--type-body-font); padding: 5px 10px; }

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

/* 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(--type-heading-font);
    font-size: var(--type-heading-size);
    font-weight: var(--type-heading-weight);
    color: rgba(255,255,255,0.9);
    flex-shrink: 0;
}
.msg-avatar-spacer {
    width: 42px;
    flex-shrink: 0;
}
.msg-tag {
    font-family: var(--type-body-font);
    font-size: var(--type-body-size);
    background: rgba(255,255,255,0.1);
    color: var(--text-2);
    padding: 1px 4px;
    border-radius: 3px;
    margin-left: 4px;
    vertical-align: middle;
}
.bot-post-image-bubble {
    background: rgba(249, 248, 248, 0.06);
    border-radius: 14px;
    border-top-left-radius: 4px;
    overflow: hidden;
    display: inline-block;
    max-width: 240px;
}
.bot-post-image-bubble img {
    width: 100%;
    display: block;
    cursor: pointer;
}


/* ======= MOBILE: VOICE MEMO PLAYER ======= */
@media (max-width: 768px) {
    .voice-memo-player {
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        bottom: 140px !important;
        top: auto !important;
        border-radius: 6px;
        z-index: 103 !important;
    }
    .voice-memo-player.docked {
        left: 12px !important;
        right: 12px !important;
        width: auto !important;
        bottom: 140px !important;
        top: auto !important;
    }

    /* Hide the small inner × — "back to archive" replaces it on mobile */
    .voice-memo-player .vm-close { display: none; }

    /* Play/pause button with text label */
    .vm-play {
        width: auto;
        border-radius: var(--control-radius);
        padding: 5px 10px;
        gap: 6px;
        flex-shrink: 0;
    }
    .vm-play::after {
        content: 'play';
        font-family: var(--type-body-font);
        font-size: var(--type-body-size);
        letter-spacing: var(--type-label-tracking);
        text-transform: lowercase;
    }
    .vm-play[data-state="playing"]::after {
        content: 'pause';
    }
}

/* ======= MOBILE: ICON TAP FEEDBACK ======= */
/* Hover doesn't exist on touch, so :active gives the only visual response. */
@media (max-width: 768px) {
    .desktop-icon:active .label {
        color: var(--accent);
    }
    .desktop-icon:active .icon {
        opacity: 0.70;
        transform: scale(0.88);
        transition: opacity 0.08s, transform 0.08s;
    }
}


@media (max-width: 768px) {
    .band-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: auto;
    }
    .band-grid > * {
        height: auto;
    }
}

/* 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(--type-code-font);
    font-size: var(--type-body-size);
    padding: 6px 16px;
    border-radius: 6px;
    z-index: 99999;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
    white-space: nowrap;
}
#adminToast.visible { opacity: 1; }


/* ================================================================
   WIDGET — styles from homepage (style.css), adapted for archive
   ================================================================ */

.intro {
  position: relative;
  background: var(--black);
  border: 1px solid rgba(255, 138, 247, 0.42);
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
  animation: fadeIn 0.6s ease both;
}

.intro, .intro * { font-family: var(--type-body-font) !important; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── WIDGET NAV ── */
.site-header {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  padding: 0;
  background: rgba(255, 138, 247, 0.07);
  border-bottom: 1px solid rgba(255, 138, 247, 0.2);
}
.site-header-left {
  display: flex;
  align-items: stretch;
  gap: 0;
}
.site-header-title {
  display: block;
  color: var(--yellow);
  padding: 4px 12px;
  font-size: var(--type-body-size);
  line-height: 1.55;
  letter-spacing: var(--type-meta-tracking);
  text-transform: uppercase;
}
.site-header button {
  background: none;
  border: none;
  font-family: var(--type-body-font);
  font-size: var(--type-body-size);
  color: var(--cyan);
  cursor: pointer;
  padding: 4px 12px;
  transition: color 0.15s, background-color 0.15s;
  line-height: 1.55;
  letter-spacing: var(--type-meta-tracking);
  text-transform: uppercase;
}
.site-header button:hover,
.site-header button.active {
  color: var(--pink);
  background: rgba(255, 138, 247, 0.12);
}
.site-header-left button:nth-of-type(3n+1) { color: var(--cyan); }
.site-header-left button:nth-of-type(3n+2) { color: var(--pink); }
.site-header-left button:nth-of-type(3n+3) { color: var(--yellow); }
.nav-sep {
  align-self: stretch;
  width: 1px;
  background: rgba(255, 138, 247, 0.28);
  color: transparent;
  user-select: none;
  overflow: hidden;
}
.mobile-inter-nav,
.site-header--mobile-only {
  display: none;
}
.box-header {
  display: flex;
  align-items: center;
  padding: 5px 12px;
  background: rgba(255, 138, 247, 0.07);
  border-bottom: 1px solid rgba(255, 138, 247, 0.2);
  font-size: var(--type-body-size);
  color: var(--yellow);
  letter-spacing: var(--type-meta-tracking);
  text-transform: uppercase;
  opacity: 0.7;
}
.box-body {
  min-height: 0;
}

.inter-nav {
  display: flex;
  align-items: center;
  padding: 5px 12px;
  background: rgba(255, 138, 247, 0.07);
  border-left: 1px solid rgba(255, 138, 247, 0.42);
  border-right: 1px solid rgba(255, 138, 247, 0.42);
  border-bottom: 1px solid rgba(255, 138, 247, 0.2);
}
.inter-nav-label {
  font-size: var(--type-body-size);
  color: var(--yellow);
  letter-spacing: var(--type-meta-tracking);
  text-transform: uppercase;
  opacity: 0.7;
}

/* ── WIDGET BODY ── */
.intro-body {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 260px;
  grid-template-areas:
    "center aside-top"
    "center aside-bottom";
  align-items: start;
  background:
    linear-gradient(to left, transparent 260px, rgba(255, 138, 247, 0.2) 260px, rgba(255, 138, 247, 0.2) 261px, transparent 261px);
  border-bottom: 1px solid rgba(255, 138, 247, 0.2);
}
.intro-body .col-center { grid-area: center; }
.intro-body .col-left { grid-area: aside-top; }
.intro-body .col-chat { grid-area: aside-bottom; }
/* Divider between the stacked About and Chat boxes. */
.intro-body .col-left {
  border-bottom: 1px solid rgba(255, 138, 247, 0.2);
}

/* ── VIDEO ROW ── */
.col-video {
  border-bottom: 1px solid rgba(255, 138, 247, 0.2);
  overflow: hidden;
}
.col-video .col-left-gif {
  width: 100%;
  aspect-ratio: 16 / 9;
}
.mobile-top-info {
  display: none;
}
.mobile-top-nav {
  display: none;
}

/* ── LEFT COLUMN ── */
.col-left {
  display: flex;
  flex-direction: column;
}
.col-left-gif {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--black);
  position: relative;
}
.col-left-gif img,
.col-left-gif video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}
.trailer-unmute-btn {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.55);
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 16px;
  font-family: var(--type-body-font);
  font-size: var(--type-body-size);
  letter-spacing: var(--type-meta-tracking);
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 6px;
}
.col-left-info {
  padding: 9px 10px 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.essay-title {
  display: none;
  font-family: var(--type-heading-font);
  font-size: var(--type-heading-size);
  line-height: var(--type-heading-line);
  color: var(--pink);
  letter-spacing: var(--type-heading-tracking);
  text-transform: uppercase;
}
.essay-desc {
  color: rgba(144, 241, 239, 0.65);
  line-height: var(--type-body-line);
}
/* 12px between the two About paragraphs (5px flex gap + 7px). */
.col-left-info .essay-desc + .essay-desc {
  margin-top: 7px;
}
/* Section nav in the left gutter, outside the box, aligned to the top of
   the Screenings section (anchored to .intro-body). */
.trailer-nav {
  position: absolute;
  top: 0;
  right: 100%;
  margin-right: 16px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.trailer-nav-link {
  background: none;
  border: none;
  font-family: var(--type-body-font);
  font-size: var(--type-body-size);
  line-height: 1.5;
  letter-spacing: var(--type-meta-tracking);
  text-transform: uppercase;
  cursor: pointer;
  padding: 2px 7px;
  text-align: right;
  white-space: nowrap;
  transition: color 0.15s, background-color 0.15s;
}
.trailer-nav-link:nth-of-type(3n+1) { color: var(--cyan); }
.trailer-nav-link:nth-of-type(3n+2) { color: var(--pink); }
.trailer-nav-link:nth-of-type(3n+3) { color: var(--yellow); }
.trailer-nav-link:hover,
.trailer-nav-link.active {
  color: var(--white);
  background: rgba(0, 0, 0, 0.5);
}
/* No left gutter in this range (page-wrap goes full width) — keep the nav
   on-screen by anchoring it inside the box at the top-left. */
@media (min-width: 581px) and (max-width: 1024px) {
  .trailer-nav {
    right: auto;
    left: 12px;
    top: 12px;
    margin-right: 0;
    align-items: flex-start;
  }
  .trailer-nav-link {
    text-align: left;
    text-shadow: 0 1px 5px rgba(0, 0, 0, 0.85);
  }
}
.essay-by {
  font-size: var(--type-body-size);
  color: rgba(144, 241, 239, 0.55);
  line-height: var(--type-body-tight);
}
.essay-by a {
  color: var(--cyan);
  text-decoration: none;
  transition: color 0.15s;
}
.essay-by a:hover { color: var(--white); }

/* ── CENTER COLUMN ── */
.col-center {
  padding: 0;
  display: flex;
  flex-direction: column;
}
.col-center-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}
.center-desc {
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
  color: rgba(144, 241, 239, 0.65);
}
.director-signoff {
  margin-top: 14px;
  color: var(--pink);
  font-size: var(--type-body-size);
}
.director-signoff a {
  color: var(--pink);
  transition: color 0.15s;
}
.director-signoff a:hover {
  color: var(--cyan);
}
.director-note-content .center-desc + .center-desc,
.director-note-content .center-desc + .director-signoff {
  margin-top: 1em;
}
.center-quote {
  color: rgba(144, 241, 239, 0.72);
  font-size: var(--type-quote-size);
  line-height: var(--type-body-line);
  margin: 12px 0 3px;
  padding-top: 9px;
  border-top: 1px solid rgba(255, 138, 247, 0.24);
  text-align: center;
}
.col-left-info .center-quote {
  font-size: var(--type-body-size);
  line-height: var(--type-body-tight);
  color: rgba(249, 248, 248, 0.58);
  margin: 0;
  padding-top: 0;
  border-top: 0;
}
.center-quote span {
  color: rgba(249, 248, 248, 0.55);
}
.screening-invite-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
  margin-bottom: 4px;
}
.screening-invite-bot-field {
  display: none;
}
.screening-invite-kicker {
  margin: 0;
  color: var(--yellow);
  font-size: 24px;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}
.screening-invite-heading,
.screening-invite-input,
.screening-invite-submit {
  min-height: 30px;
}
.screening-invite-heading {
  display: block;
  color: rgba(249, 248, 248, 0.78);
  padding: 0;
  margin: 0 0 4px;
  font-family: var(--type-heading-font);
  font-size: 17px;
  font-weight: var(--type-body-weight);
  line-height: 1.42;
  text-transform: none;
  text-align: left;
}
.screening-invite-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.screening-invite-input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 138, 247, 0.72);
  background: transparent;
  color: var(--white);
  padding: 12px;
  outline: none;
  line-height: var(--type-caption-line);
  text-align: center;
  font-size: 17px;
  border-radius: var(--control-radius);
  margin-bottom: 3px;
}
.screening-invite-input::placeholder {
  color: rgba(249, 248, 248, 0.38);
}
.screening-invite-input:focus {
  border-color: var(--cyan);
}
.screening-invite-submit {
  width: 100%;
}
.screening-invite-success,
.screening-invite-status {
  margin-top: 8px;
  color: var(--yellow);
  font-family: var(--type-heading-font);
  font-size: var(--type-heading-size);
  font-weight: var(--type-heading-weight);
  line-height: var(--type-heading-line);
  text-align: center;
}
.screening-invite-status {
  color: var(--pink);
  font-size: var(--type-body-size);
}
.link-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.link-item {
  color: var(--cyan);
  text-decoration: none;
  font-size: var(--type-body-size);
  transition: color 0.15s;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--type-body-font);
  padding: 0;
  text-align: left;
}
.link-item:hover { color: var(--white); }
.link-item:disabled { color: rgba(144, 241, 239, 0.55); opacity: 0.5; cursor: default; }
.link-item:disabled:hover { color: rgba(144, 241, 239, 0.55); }
.cta-btn {
  background: var(--pink);
  color: var(--black);
  border: none;
  padding: 12px;
  border-radius: var(--control-radius);
  font-family: var(--type-heading-font);
  font-size: 18px;
  font-weight: var(--type-heading-weight);
  cursor: pointer;
  text-align: center;
  transition: opacity 0.15s;
  width: 100%;
  text-decoration: none;
  display: block;
}
.cta-btn:hover {
  background: var(--cyan);
  color: var(--black);
}
.cta-btn-secondary {
  background: rgb(33 21 33);
  color: rgba(249, 248, 248, 0.62);
  border: 0;
  font-weight: var(--type-body-weight);
  letter-spacing: 0;
  text-transform: none;
  padding-top: 10px;
  padding-bottom: 10px;
}
.cta-btn-secondary:hover {
  background: rgb(43 28 43);
  color: var(--cyan);
}
.cta-btn-tertiary {
  background: rgb(33 21 33);
  color: rgba(249, 248, 248, 0.62);
  border: 0;
  font-weight: var(--type-body-weight);
  letter-spacing: 0;
  text-transform: none;
  padding-top: 10px;
  padding-bottom: 10px;
}
.cta-btn-tertiary:hover {
  background: rgb(43 28 43);
  color: var(--cyan);
}
.mobile-home-link {
  display: block;
}
.cta-btn:disabled { background: rgba(144, 241, 239, 0.55); opacity: 0.45; cursor: default; }

/* ── CHAT COLUMN ── */
.col-chat {
  display: flex;
  flex-direction: column;
  align-self: start;
  flex: 0 0 var(--home-chat-height);
  height: var(--home-chat-height);
  max-height: var(--home-chat-height);
  min-height: 0;
  overflow: hidden;
}
.chat-feed {
  flex: 0 1 auto;
  height: calc(var(--home-chat-height) - var(--home-chat-header-height));
  max-height: calc(var(--home-chat-height) - var(--home-chat-header-height));
  position: relative;
  overflow-y: auto;
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  scrollbar-width: thin;
  scrollbar-color: rgba(234,240,0,0.25) transparent;
}
.chat-feed::-webkit-scrollbar { width: 2px; }
.chat-feed::-webkit-scrollbar-thumb { background: rgba(234,240,0,0.35); }
.chat-msg {
  display: flex;
  flex-direction: column;
  gap: 2px;
  animation: msgIn 0.2s ease;
}
@keyframes msgIn {
  from { opacity: 0; transform: translateY(3px); }
  to   { opacity: 1; transform: translateY(0); }
}
.chat-user {
  font-size: var(--type-body-size);
  font-weight: var(--type-heading-weight);
  letter-spacing: var(--type-meta-tracking);
}
.chat-text {
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
  color: rgba(249, 248, 248, 0.7);
  word-break: break-word;
}
.chat-typing {
  font-size: var(--type-body-size);
  color: rgba(144, 241, 239, 0.55);
  font-family: var(--type-body-font);
  letter-spacing: var(--type-body-tracking);
  text-align: center;
  margin-bottom: 8px;
}

/* ── TICKER ── */

/* ── MODAL PANELS (About / Screenings / Credits / Contact) ── */
.panel:not(.desktop) {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(17, 11, 17, 0.97);
  opacity: 0;
  transform: translateY(18px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
  overflow-y: auto;
  padding-bottom: 6rem;
}
.panel:not(.desktop).active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.panel-inner {
  max-width: 640px;
  margin: 0 auto;
  padding: 4rem 2rem 2rem;
}
.panel-close {
  position: sticky;
  top: 1.5rem;
  z-index: 1;
  display: flex;
  justify-content: flex-end;
  padding: 0 2rem;
}
.panel-close button {
  background: none;
  border: none;
  font-family: var(--type-heading-font);
  font-size: var(--type-body-size);
  letter-spacing: var(--type-label-tracking);
  text-transform: uppercase;
  color: rgba(144, 241, 239, 0.55);
  cursor: pointer;
  transition: color 0.2s;
}
.panel-close button:hover { color: var(--white); }
.panel-label {
  font-size: var(--type-body-size);
  font-weight: var(--type-label-weight);
  letter-spacing: var(--type-label-tracking);
  color: var(--yellow);
  text-transform: uppercase;
  margin-bottom: 2rem;
}
.panel-inner p {
  font-size: var(--type-body-size);
  line-height: var(--type-body-loose);
  color: rgba(144, 241, 239, 0.55);
}
.panel-inner p + p { margin-top: 1.4rem; }

@media (min-width: 581px) {
  .panel:not(.desktop) {
    background: rgba(17, 11, 17, 0.75);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 4rem 2rem;
    overflow-y: auto;
  }
  .panel-box {
    width: min(560px, 90vw);
    background: var(--black);
    border: 1px solid rgba(255, 138, 247, 0.42);
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
  }
  .panel-close {
    position: static;
    padding: 5px 10px;
    background: rgba(255, 138, 247, 0.07);
    border-bottom: 1px solid rgba(255, 138, 247, 0.2);
  }
  .panel-inner {
    max-width: unset;
    margin: 0;
    padding: 16px;
    max-height: 70vh;
    overflow-y: auto;
  }
  .panel-label {
    font-size: var(--type-body-size);
    letter-spacing: var(--type-label-tracking);
    margin-bottom: 14px;
  }
  .panel-inner p { font-size: var(--type-body-size); line-height: var(--type-body-loose); }
  .panel-inner p + p { margin-top: 1rem; }
  .screening-list { margin-top: 12px; }
  .screening-list li { padding: 0.7rem 0; }
  .screening-list li > div p { font-size: var(--type-body-size); letter-spacing: var(--type-heading-tracking); }
  dl { margin-top: 12px; }
  dl > div { grid-template-columns: 140px 1fr; padding: 0.6rem 0; font-size: var(--type-body-size); }
  .contact-email { font-size: var(--type-heading-size); margin-top: 1rem; }
  .contact-note { font-size: var(--type-body-size); }
  .panel-footer { margin-top: 2rem; padding-top: 1rem; }
}

/* ── SCREENINGS ── */
.screening-list {
  list-style: none;
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
}
.screening-list li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: baseline;
  border-bottom: 1px solid rgba(255, 138, 247, 0.2);
  padding: 1.2rem 0;
}
.screening-list li > div p {
  font-family: var(--type-heading-font);
  font-size: var(--type-body-size);
  color: var(--white);
  line-height: var(--type-heading-line);
  text-transform: uppercase;
  letter-spacing: var(--type-heading-tracking);
}
.screening-list li > div .panel-label { display: block; margin-top: 0.2rem; margin-bottom: 0; }
.screening-list li > .panel-label { white-space: nowrap; margin-bottom: 0; }

/* ── CREDITS ── */
dl {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
}
dl > div {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 1rem;
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
  border-bottom: 1px solid rgba(255, 138, 247, 0.2);
  padding: 0.9rem 0;
  font-family: var(--type-body-font);
}
dl > div .panel-label { margin-bottom: 0; }
dl dd { color: var(--white); margin: 0; }

/* ── CONTACT ── */
.contact-email {
  display: inline-block;
  margin-top: 1.8rem;
  font-size: var(--type-heading-size);
  color: var(--pink);
  text-decoration: none;
  font-family: var(--type-heading-font);
  transition: opacity 0.2s;
}
.contact-email:hover { opacity: 0.7; }
.contact-note {
  margin-top: 1rem;
  font-size: var(--type-body-size);
  color: rgba(144, 241, 239, 0.55);
  letter-spacing: var(--type-status-tracking);
  font-family: var(--type-body-font);
}
.panel-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 138, 247, 0.2);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.footer-copy {
  font-size: var(--type-body-size);
  letter-spacing: var(--type-status-tracking);
  color: rgba(200, 255, 200, 0.18);
  font-family: var(--type-body-font);
}

/* ── INLINE SECTION CONTENT ── */
.inline-section { display: flex; flex-direction: column; gap: 3px; }
.screening-row {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--pink);
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
}
.screening-row:last-of-type {
  border-bottom: 0;
}
.screening-row .panel-label {
  margin-bottom: 0;
  font-size: var(--type-micro-size);
}
.screening-row .sidebar-venue::before {
  content: " / ";
  color: rgba(249, 248, 248, 0.35);
}
.screening-photos {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 8px 0 4px;
}
.screening-photos figure {
  margin: 0;
}
.screening-photos img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid rgba(255, 138, 247, 0.28);
}
.screening-photo-credit {
  margin: 0 0 3px;
  color: rgba(249, 248, 248, 0.5);
  font-size: var(--type-micro-size);
  line-height: var(--type-caption-line);
  text-transform: uppercase;
  letter-spacing: var(--type-meta-tracking);
}
.inline-credits {
  display: flex;
  flex-direction: column;
}
.credit-row {
  display: grid;
  grid-template-columns: 105px 1fr;
  gap: 8px;
  font-size: var(--type-body-size);
  line-height: var(--type-body-line);
  border-bottom: 1px solid rgba(255, 138, 247, 0.2);
  padding: 5px 0;
}
.credit-row .panel-label { margin-bottom: 0; font-size: var(--type-micro-size); }
.credit-row span:last-child { color: var(--white); }
.credit-row-full {
  display: block;
}
.credit-row-full span {
  display: block;
}
.credit-row a {
  color: var(--white);
  text-decoration: none;
  transition: color 0.15s;
}
.credit-row a:hover {
  color: var(--accent);
}
.credit-note {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.52);
}
.contact-inline {
  display: inline-block;
  margin: 6px 0;
  font-size: var(--type-body-size);
  color: var(--pink);
  text-decoration: none;
  transition: opacity 0.15s;
}
.contact-inline:hover { opacity: 0.7; }
.mobile-section-nav { display: none; }
.col-center .panel-label { margin-bottom: 6px; }

/* Shared bright handle palette for Discord-style usernames across site + film view. */
.chat-msg:nth-child(7n+1) .chat-user,
.card-comment:nth-child(7n+1) .comment-handle,
.gc-message:nth-child(7n+1) .gc-name {
  color: #ff4fd8 !important;
}

.chat-msg:nth-child(7n+2) .chat-user,
.card-comment:nth-child(7n+2) .comment-handle,
.gc-message:nth-child(7n+2) .gc-name {
  color: #00f5ff !important;
}

.chat-msg:nth-child(7n+3) .chat-user,
.card-comment:nth-child(7n+3) .comment-handle,
.gc-message:nth-child(7n+3) .gc-name {
  color: #eaff00 !important;
}

.chat-msg:nth-child(7n+4) .chat-user,
.card-comment:nth-child(7n+4) .comment-handle,
.gc-message:nth-child(7n+4) .gc-name {
  color: #7cff6b !important;
}

.chat-msg:nth-child(7n+5) .chat-user,
.card-comment:nth-child(7n+5) .comment-handle,
.gc-message:nth-child(7n+5) .gc-name {
  color: #ff9f1c !important;
}

.chat-msg:nth-child(7n+6) .chat-user,
.card-comment:nth-child(7n+6) .comment-handle,
.gc-message:nth-child(7n+6) .gc-name {
  color: #a78bfa !important;
}

.chat-msg:nth-child(7n) .chat-user,
.card-comment:nth-child(7n) .comment-handle,
.gc-message:nth-child(7n) .gc-name {
  color: #ff5f57 !important;
}

/* ── WIDGET MOBILE ── */
@media (max-width: 768px) {
  :root {
    --type-body-size:    16px;
    --type-heading-size: 18px;
    --type-micro-size:   11px;
    --type-quote-size:   18px;
    --home-chat-header-height: 40px;
  }
  .intro {
    border-left: 0;
    border-right: 0;
    border-top: 0;
    background: var(--black);
  }
  .center-quote {
    display: none;
  }
  .intro > .site-header,
  .site-header--mobile-only {
    display: none;
  }
  .desktop-home-link { display: none; }
  .trailer-nav { display: none !important; }
  .mobile-top-info {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 24px;
    border-bottom: 1px solid rgba(255, 138, 247, 0.2);
  }
  .mobile-film-title {
    color: var(--yellow);
    font-size: 30px;
    line-height: 1.12;
    letter-spacing: 0;
  }
  .mobile-film-meta,
  .mobile-screening-kicker {
    color: rgba(144, 241, 239, 0.72);
    font-size: 13px;
    line-height: 1.3;
    letter-spacing: var(--type-meta-tracking);
    text-transform: uppercase;
  }
  .mobile-film-meta {
    margin-top: -6px;
  }
  .mobile-film-desc {
    margin: 0;
    color: var(--white);
    font-size: 22px;
    line-height: 1.24;
    text-align: left;
    letter-spacing: 0;
  }
  .mobile-top-info .screening-invite-form {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 18px 0 0;
    border-top: 1px solid rgba(255, 138, 247, 0.22);
    border-bottom: 0;
    gap: 10px;
  }
  .mobile-screening-kicker {
    margin: 0;
    color: var(--yellow);
    font-size: 24px;
    line-height: 1.3;
    letter-spacing: 0;
    text-transform: none;
  }
  .mobile-top-info .screening-invite-heading {
    margin: 0 0 4px;
    color: rgba(249, 248, 248, 0.78);
    font-size: 17px;
    font-weight: var(--type-body-weight);
    line-height: 1.42;
    text-align: left;
    letter-spacing: 0;
  }
  .mobile-top-info .screening-invite-input {
    padding: 14px 12px;
    text-align: left;
    font-size: 16px;
  }
  .mobile-top-nav {
    display: flex;
    flex-direction: column;
    margin-top: 4px;
    border-top: 1px solid rgba(255, 138, 247, 0.22);
  }
  .mobile-top-nav-link {
    min-height: 44px;
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 10px;
    border: 0;
    border-bottom: 1px solid rgba(255, 138, 247, 0.18);
    background: transparent;
    color: rgba(249, 248, 248, 0.76);
    padding: 12px 0;
    font-family: var(--type-body-font);
    font-size: 16px;
    line-height: 1.25;
    text-align: left;
    cursor: pointer;
    border-radius: 0;
  }
  .mobile-top-nav-link span {
    color: rgba(255, 138, 247, 0.62);
    font-family: var(--type-code-font);
    font-size: 12px;
  }
  .mobile-top-nav-link:active,
  .mobile-top-nav-link:hover {
    color: var(--cyan);
  }
  .mobile-top-nav-link:active span,
  .mobile-top-nav-link:hover span {
    color: var(--yellow);
  }
  .intro-body {
    display: none;
  }
  .col-video {
    order: 1;
    border-bottom: 0;
  }
  .col-video .col-left-gif {
    aspect-ratio: 4 / 3;
    height: auto;
  }
  .trailer-unmute-btn {
    right: 14px;
    bottom: 14px;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 13px;
    background: rgba(17, 11, 17, 0.72);
    backdrop-filter: blur(8px);
  }
  .col-left {
    order: 2;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid rgba(255, 138, 247, 0.2);
  }
  .col-left > .box-header {
    display: none;
  }
  .col-left-gif {
    width: 100%;
    aspect-ratio: 16 / 9;
  }
  .col-left-info {
    border-top: 0;
    justify-content: flex-start;
    padding: 22px 18px 24px;
    gap: 12px;
  }
  .essay-title {
    display: block;
    color: var(--yellow);
    font-size: 28px;
    line-height: 1.14;
    letter-spacing: 0;
    text-transform: none;
  }
  .col-center { order: 3; border-bottom: 1px solid rgba(255, 138, 247, 0.2); padding: 0; }
  .col-chat > .box-header {
    padding: 9px 18px;
    background: transparent;
    border-top: 1px solid rgba(255, 138, 247, 0.2);
    color: var(--cyan);
    opacity: 0.85;
  }
  .col-center > .box-header {
    display: none;
  }
  .col-center-body {
    padding: 20px 18px 22px;
    gap: 12px;
  }
  .screening-invite-form {
    margin: 0;
    padding: 0;
    border-bottom: 0;
    gap: 10px;
  }
  .essay-desc,
  .screening-invite-heading {
    margin: 0 0 6px;
    color: var(--white);
    font-size: 22px;
    line-height: 1.24;
    text-align: left;
    letter-spacing: 0;
  }
  .screening-invite-heading {
    font-family: var(--type-heading-font);
    font-weight: var(--type-heading-weight);
  }
  .screening-invite-input {
    padding: 14px 12px;
    text-align: left;
    font-size: 16px;
  }
  .col-chat {
    order: 4;
    flex-basis: 320px;
    height: 320px;
    max-height: 320px;
    min-height: 0;
    border-top: 0;
  }
  .chat-feed {
    height: calc(320px - var(--home-chat-header-height));
    max-height: calc(320px - var(--home-chat-header-height));
    position: relative;
    min-height: 0;
    padding: 12px 18px 18px;
    gap: 10px;
  }
  .mobile-inter-nav {
    display: flex;
    align-items: center;
    margin-top: 4px;
    padding: 10px 0 0;
    background: transparent;
    border-top: 1px solid rgba(255, 138, 247, 0.24);
    border-bottom: 0;
    font-size: 13px;
    color: var(--yellow);
    letter-spacing: var(--type-meta-tracking);
    text-transform: uppercase;
    opacity: 0.7;
  }
  .mobile-home-link,
  .col-center-body > .cta-btn-tertiary {
    padding: 12px 0;
    background: transparent;
    border-bottom: 1px solid rgba(255, 138, 247, 0.18);
    color: rgba(249, 248, 248, 0.72);
    text-align: left;
    font-size: 16px;
  }
  .mobile-section-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 10px;
    margin-bottom: 8px;
  }
  .mobile-section-nav button {
    background: none;
    border: none;
    color: var(--cyan);
    cursor: pointer;
    font-family: var(--type-body-font);
    font-size: var(--type-body-size);
    padding: 0;
  }
  .screening-photos {
    grid-template-columns: 1fr;
  }
  .screening-row {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  dl > div { grid-template-columns: 1fr; gap: 0.2rem; }
}
