

:root {
    /* Keep the theme colors even when Windows contrast themes or Chrome's
       auto dark mode would otherwise repaint all text/borders white. */
    color-scheme: dark;
    forced-color-adjust: none;
    --renegade-accent: #d4af37;
    --renegade-accent-rgb: 212, 175, 55;
    --renegade-code-color: #39ff14;
    --renegade-assistant-color: #8fdcff;
    --renegade-overlay-image: url('images/overlay.png');
    --renegade-overlay-image-mobile: url('images/mobile-overlay.jpg');
}

html {
    background-color: #000;
    overscroll-behavior-y: contain;
}

body {
    margin: 0;
    background-color: #000;
    color: var(--renegade-accent);
    font-family: 'Orbitron', sans-serif;
    box-sizing: border-box;
    overscroll-behavior-y: contain;
}

*, *::before, *::after {
    box-sizing: border-box;
}

#overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-image: var(--renegade-overlay-image);
    background-position: 0 0;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    z-index: -1;
}


#theme-frame-overlay {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-image: var(--renegade-overlay-image);
    background-position: 0 0;
    background-size: 100% 100%;
    background-repeat: no-repeat;
    /* Above the panel layer (panel-stack.js: 10200+) so the theme frame still
       sits on top of panels like it did at 10000 vs their 9999; below menus/toasts. */
    z-index: 19999;
    pointer-events: none;
}

html.theme-frame-active #theme-frame-overlay {
    display: block;
}

#intro {
    position: fixed;
    inset: 0;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    opacity: 1;
    transition: opacity 1s ease;
}

#intro-scorpion {
    width: 700px;
    max-width: 90vw;
    height: auto;
    margin-bottom: 20px;
}

#intro-text {
    color: var(--renegade-accent);
    font-size: 1.8rem;
    font-family: 'Courier New', monospace;
    text-align: center;
}

#auth-gate-overlay {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    z-index: 9995;
    display: none;
    pointer-events: none;
}

#auth-gate-overlay.visible {
    display: block;
}

body.auth-locked .left-nav,
body.auth-locked .right-nav,
body.auth-locked .top-bar,
body.auth-locked .input-bar,
body.auth-locked #chat-window {
    pointer-events: none;
}

body.auth-locked .left-nav #login-btn,
body.auth-locked .input-bar #user-input,
body.auth-locked .input-bar #send-btn {
    pointer-events: auto;
}

#minimized-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 20px;
    display: flex;
    flex-direction: row-reverse;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 0 20px;
    z-index: 9999;
    pointer-events: none; 
}

#minimized-dock > * {
    pointer-events: auto;
}

#comfy-fullscreen-overlay {
    display: none;
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background-color: #000;
    z-index: 10050;
}

#comfy-fullscreen-overlay.open {
    display: block;
}

#comfy-fullscreen-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

#comfy-fullscreen-close-btn {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 10051;
    background-color: #000;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
}

#comfy-fullscreen-close-btn:hover {
    background-color: var(--renegade-accent);
    color: #000;
}

#title-banner {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--renegade-accent);
    text-shadow: 0 0 15px var(--renegade-accent), 0 0 30px #000;
    z-index: 10;
    white-space: nowrap;
}

.top-bar {
    position: fixed;
    top: 120px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 40px;
    z-index: 15;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

#chat-search-btn {
    width: 40px !important;
    height: 30px !important;
    flex-shrink: 0;
    padding: 0;
    background-color: #000;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    box-sizing: border-box;
}

#chat-search-btn:hover {
    background-color: var(--renegade-accent);
    color: #000;
}

.left-nav {
    position: fixed;
    top: 20vh;
    left: 4%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 9%;
    z-index: 20;
}

.left-nav > button {
    width: 130px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0;
    box-sizing: border-box;
    
    border: 2px solid var(--renegade-accent);
    box-shadow: 0 0 15px var(--renegade-accent);
}

.find-bug-severity-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333;
}

.find-bug-severity-toggle {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    cursor: pointer;
    background: transparent;
    opacity: 0.4;
    box-sizing: border-box;
}

.find-bug-severity-toggle.active {
    opacity: 1;
}

.find-bug-severity-critical {
    border: 1px solid #ff3b3b;
    color: #ff3b3b;
}

.find-bug-severity-high {
    border: 1px solid #ff9d3b;
    color: #ff9d3b;
}

.find-bug-severity-medium {
    border: 1px solid var(--renegade-accent);
    color: var(--renegade-accent);
}

.find-bug-severity-low {
    border: 1px solid #888;
    color: #999;
}

.find-bug-issue-group {
    margin-bottom: 4px;
}

.find-bug-rescan-btn {
    display: block;
    margin-top: 14px;
    padding: 8px 14px;
    background: #111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.find-bug-rescan-btn:hover {
    background: var(--renegade-accent);
    color: #000;
}

.find-bug-action-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.find-bug-action-panel > * {
    margin-left: auto;
    margin-right: auto;
}

.find-bug-code-fix {
    background: #ff0000 !important;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 20%;
    box-sizing: border-box;
    margin: 8px 0;
    padding: 8px 12px;
    background: transparent !important;
    border: 1px solid #ff0000 !important;
    border-radius: 6px;
    color: inherit !important;
    cursor: pointer;
    justify-content: center;
    text-align: center;
    margin: 8px auto;
    animation: repairCodePulse 1.5s ease-in-out infinite;
}

.find-bug-code-fix .code-fix-icon {
    color: unset !important;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif !important;
}

.find-bug-code-fix:hover {
    background: #ff0000 !important;
    color: #000 !important;
    border-color: #ff0000 !important;
    box-shadow:
        0 0 15px rgba(255, 0, 0, 0.95),
        0 0 30px rgba(255, 0, 0, 0.65),
        0 0 45px rgba(255, 0, 0, 0.35) !important;
    animation: none !important;
}

.find-bug-code-fix:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    animation: none !important;
}

.find-bug-fix-card {
    border: 1px solid var(--renegade-accent);
    border-radius: 8px;
    background: #050505;
    box-shadow: 0 0 8px rgba(var(--renegade-accent-rgb), 0.2);
    margin: 10px 0;
    padding: 10px 12px;
    box-sizing: border-box;
    text-align: left;
}

.find-bug-fix-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    color: var(--renegade-accent);
    margin-bottom: 4px;
}

.find-bug-fix-confidence {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid var(--renegade-accent);
    border-radius: 4px;
    padding: 1px 6px;
    opacity: 0.85;
}

.find-bug-fix-location {
    color: #999;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    margin-bottom: 4px;
}

.find-bug-fix-reason {
    color: #ccc;
    font-size: 0.85rem;
    margin-bottom: 8px;
}

.find-bug-explain-fix-btn {
    display: inline-block;
    margin-bottom: 8px;
    padding: 3px 10px;
    background: transparent;
    color: var(--renegade-assistant-color);
    border: 1px solid rgba(143, 220, 255, 0.4);
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.75rem;
}

.find-bug-explain-fix-btn:hover {
    border-color: var(--renegade-assistant-color);
    background: rgba(143, 220, 255, 0.08);
}

.find-bug-explain-fix-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.find-bug-fix-explanation {
    background: #0a0a0a;
    border: 1px solid rgba(143, 220, 255, 0.25);
    border-radius: 6px;
    padding: 8px 10px;
    margin-bottom: 8px;
    color: #cde9f7;
    font-size: 0.82rem;
    line-height: 1.5;
}

.find-bug-code-label {
    color: var(--renegade-accent);
    font-family: 'Courier New', monospace;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 6px 0 2px;
}

.find-bug-code-before {
    color: #ff5f5f;
}

.find-bug-code-after {
    color: var(--renegade-code-color);
}

.find-bug-confidence-confirm {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 8px;
    border: 1px dashed var(--renegade-accent);
    border-radius: 5px;
    color: var(--renegade-accent);
    font-size: 0.78rem;
    cursor: pointer;
}

.find-bug-confidence-confirm input[type="checkbox"] {
    accent-color: var(--renegade-accent);
    cursor: pointer;
    flex-shrink: 0;
}

.renegade-modal-panel {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background-color: #000000;
    border: 1px solid var(--renegade-accent);
    border-radius: 10px;
    padding: 18px;
    width: 280px;
    box-sizing: border-box;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.renegade-modal-panel.open {
    display: block !important;
}

.renegade-modal-title {
    color: var(--renegade-accent);
    font-size: 20px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 15px;
}

/* showRenegadeConfirm()'s dialog (friends.js) - a shared "are you sure?"
   used for deleting a message, clearing a chat, and deleting a pinned
   note. This had NO css at all: appended straight to document.body with
   no position/z-index, it rendered as a plain static div at the bottom of
   the page instead of an overlay, so it was invisible/unreachable
   wherever it was triggered from inside a fixed-position panel (the
   confirm click handlers were always fine - there was just no visible,
   clickable dialog for the user to click them on). That's why actions
   depending on it (like the note composer's new Delete button) looked
   like they silently did nothing. z-index is intentionally higher than
   .renegade-modal-panel's 9999 so this can confirm an action from inside
   ANY panel, including ones already stacked on top of others. */
.renegade-confirm-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.75);
}

.renegade-confirm-panel {
    width: 100%;
    max-width: 320px;
    background-color: #141414;
    border: 1px solid var(--renegade-accent);
    border-radius: 12px;
    padding: 18px;
    box-sizing: border-box;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
}

.renegade-confirm-text {
    color: #fff;
    font-size: 14px;
    line-height: 1.4;
    text-align: center;
    margin-bottom: 16px;
}

.renegade-confirm-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.renegade-confirm-cancel-btn,
.renegade-confirm-confirm-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

.renegade-confirm-cancel-btn {
    background: none;
    border: 1px solid #444;
    color: #ccc;
}

.tools-panel {
    width: 220px;
}

.tools-panel-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tools-panel-buttons > button {
    width: 100%;
    box-sizing: border-box;
}

.tools-panel-close-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid #ff4d4d;
    color: #ff4d4d;
    border-radius: 6px;
    font-size: 12px;
    line-height: 1;
    cursor: pointer;
}

.tools-panel-close-btn:hover {
    background-color: #ff4d4d;
    color: #000000;
}

#settings-panel {
    width: 280px;
}

.settings-panel-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.settings-panel-button {
    width: 100%;
    padding: 12px;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 2px solid var(--renegade-accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    box-sizing: border-box;
}

.settings-panel-button:hover {
    background-color: #222222;
}

#get-app-panel {
    width: 280px;
}

.get-app-panel-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.get-app-panel-button {
    width: 100%;
    padding: 12px;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 2px solid var(--renegade-accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    box-sizing: border-box;
}

.get-app-panel-button:hover {
    background-color: #222222;
}

#games-panel {
    width: 320px;
    max-height: 82vh;
    overflow-y: auto;
}

.games-panel-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.games-panel-button {
    width: 100%;
    padding: 12px;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 2px solid var(--renegade-accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    box-sizing: border-box;
}

.games-panel-button:hover {
    background-color: #222222;
}


.games-panel-section-label {
    color: #888888;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 16px 0 8px;
}

.games-installed-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 260px;
    overflow-y: auto;
}

.games-installed-empty {
    color: #777777;
    font-size: 13px;
    text-align: center;
    padding: 14px 6px;
}

.games-installed-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #111111;
    border: 1px solid #2a2a2a;
    border-radius: 8px;
    padding: 8px 10px;
    box-sizing: border-box;
}

.games-installed-icon {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    border-radius: 8px;
    object-fit: cover;
    background-color: #1a1a1a;
}

.games-installed-name {
    flex: 1;
    min-width: 0;
    color: var(--renegade-accent);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.games-installed-play-btn,
.games-installed-invite-btn {
    flex-shrink: 0;
    background-color: #1a1a1a;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.games-installed-play-btn:hover,
.games-installed-invite-btn:hover {
    background-color: #262626;
}


.games-invite-popup {
    width: 300px;
    max-height: 78vh;
}

.games-invite-popup #games-invite-popup-list {
    max-height: 45vh;
    overflow-y: auto;
    margin-bottom: 14px;
}


.chat-invite-popup {
    width: 300px;
    max-height: 78vh;
}

.chat-invite-popup #chat-invite-popup-list {
    max-height: 45vh;
    overflow-y: auto;
    margin-bottom: 14px;
}

.games-invite-friend-row {
    display: block;
    width: 100%;
    text-align: left;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid #2a2a2a;
    border-radius: 6px;
    padding: 10px 12px;
    margin-bottom: 6px;
    font-size: 14px;
    cursor: pointer;
    box-sizing: border-box;
}

.games-invite-friend-row:hover {
    background-color: #1c1c1c;
}

.games-invite-friend-row:disabled {
    opacity: 0.5;
    cursor: default;
}

.friends-panel {
    width: 300px;
    max-height: 78vh;
    overflow-y: auto;
}

.friends-self-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 12px;
    margin-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.friends-self-name {
    color: var(--renegade-accent);
    font-weight: bold;
    font-size: 14px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friends-search-input {
    width: 100%;
    padding: 10px 12px;
    background-color: #111111;
    color: #fff;
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
    margin-bottom: 8px;
}

.friends-search-input:focus {
    outline: none;
    box-shadow: 0 0 0 1px var(--renegade-accent);
}

.friends-list-box {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.friends-section {
    margin-top: 14px;
}

.friends-section-heading {
    color: var(--renegade-accent);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    opacity: 0.75;
    margin-bottom: 8px;
}

.friends-empty-state {
    padding: 10px 4px;
    font-size: 12px;
    color: #999;
    text-align: center;
}

.friend-row {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px;
    border-radius: 6px;
}

.friend-row-clickable {
    cursor: pointer;
}

.friend-row-clickable:hover {
    background-color: #161616;
}

.friend-row-menu-open {
    z-index: 10;
}

.friend-row-menu {
    position: fixed;
    display: flex;
    flex-direction: column;
    min-width: 140px;
    max-width: calc(100vw - 16px);
    padding: 4px;
    background-color: #111111;
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    z-index: 20000;
}

.friend-row-menu-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    text-align: left;
    white-space: nowrap;
}

.friend-row-menu-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.friend-row-menu-btn-danger {
    color: #ff6b6b;
    border-color: rgba(255, 59, 59, 0.4);
}

.friend-avatar-img {
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--renegade-accent);
    background-color: #111111;
    flex-shrink: 0;
    display: block;
}

.friend-avatar-placeholder {
    border-radius: 50%;
    border: 2px solid var(--renegade-accent);
    background-color: #111111;
    color: var(--renegade-accent);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 13px;
}

.friend-avatar-status-online,
.friend-avatar-status-offline-pulse,
.friend-avatar-status-offline-static {
    border-color: transparent;
}

.friend-avatar-status-online {
    animation: friendAvatarPulseGreen 1.6s ease-in-out infinite;
}

.friend-avatar-status-offline-pulse {
    animation: friendAvatarPulseRed 1.6s ease-in-out infinite;
}

.friend-avatar-status-offline-static {
    border-color: #ff4d4d;
}

@keyframes friendAvatarPulseGreen {
    0%, 100% {
        border-color: #39ff14;
        box-shadow: 0 0 0 0 rgba(57, 255, 20, 0.55);
    }
    50% {
        border-color: #39ff14;
        box-shadow: 0 0 0 6px rgba(57, 255, 20, 0);
    }
}

@keyframes friendAvatarPulseRed {
    0%, 100% {
        border-color: #ff4d4d;
        box-shadow: 0 0 0 0 rgba(255, 77, 77, 0.55);
    }
    50% {
        border-color: #ff4d4d;
        box-shadow: 0 0 0 6px rgba(255, 77, 77, 0);
    }
}

.friend-row-name {
    flex: 1;
    min-width: 0;
    color: #fff;
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-row-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.friend-row-button {
    padding: 6px 10px;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    white-space: nowrap;
}

.friend-row-button:hover {
    background-color: #222222;
}

.friend-row-button:disabled {
    opacity: 0.6;
    cursor: default;
}

.friend-row-button-muted {
    color: #999;
    border-color: #444;
}

.friend-row-badge {
    font-size: 11px;
    color: #999;
}

.friend-request-popup {
    width: 280px;
    max-height: 60vh;
    overflow-y: auto;
    
    z-index: 2147483647 !important;
}

.friend-online-toast-stack {
    position: fixed;
    top: 16px;
    right: 16px;
    
    z-index: 2147483647 !important;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.friend-online-toast {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 200px;
    max-width: 260px;
    background-color: #000000;
    border: 1px solid var(--renegade-accent);
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: auto;
}

.friend-online-toast.friend-online-toast-hide {
    opacity: 0;
    transform: translateX(12px);
}

.friend-online-toast-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.friend-online-toast-name {
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-online-toast-status {
    
    color: #39ff14;
    font-size: 11px;
    font-weight: bold;
}

.friend-message-toast {
    cursor: pointer;
}

.friend-message-toast-status {
    color: var(--renegade-accent);
}

.friend-invite-accepted-toast-status {
    color: #39ff14;
}

.game-invite-popup {
    width: 300px;
    border-color: #39ff14;
    box-shadow: 0 0 20px rgba(57, 255, 20, 0.35);
    
    z-index: 2147483647 !important;
}

.game-invite-popup .renegade-modal-title {
    color: #39ff14;
}

.game-invite-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: 8px;
    background-color: #111111;
}

.game-invite-row-text {
    flex: 1;
    min-width: 0;
}

.game-invite-row-line {
    color: #39ff14;
    font-size: 13px;
    line-height: 1.4;
}

.game-invite-row-line strong {
    color: #39ff14;
}

.game-invite-row-actions {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex-shrink: 0;
}

.friend-chat-panel {
    padding: 14px;
}

/* Wraps the titlebar and (when one is pinned) the note bar as a single
   unit that's locked to the top of the panel regardless of anything
   scrolling beneath it - flex-shrink:0 on the titlebar alone only stopped
   IT from shrinking, it never stopped the panel's own scroll/viewport
   quirks (mobile keyboard resize, momentum-scroll overshoot in the
   messages list, etc.) from dragging it out of view along with everything
   else. position:sticky with its own opaque background is a much harder
   guarantee: this wrapper always stays pinned to the top of its
   containing block no matter what the message list below it is doing.
   Wrapping both together (rather than making each sticky separately) means
   the note bar doesn't need to know the titlebar's height to compute its
   own `top` offset - they just stick as one stacked unit. */
.friend-chat-header-sticky {
    position: sticky;
    top: 0;
    z-index: 5;
    background-color: #000000;
    flex-shrink: 0;
    margin-bottom: 10px;
}

.friend-chat-titlebar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Wraps up to MAX_CHAT_NOTES_PER_CONVERSATION (5) pinned-note bars, lives
   inside .friend-chat-header-sticky right below the titlebar so the whole
   stack is locked in view the same way. Capped height + its own scroll so
   5 expanded notes can't push the titlebar/stack out of proportion with
   the rest of the chat panel. */
.friend-chat-pinned-notes {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
    margin-top: 2px;
}

/* One pinned note bar. Collapsed by default (just the header row);
   .expanded reveals the full body underneath. Individual bars are only
   ever in the DOM while their note exists (see renderPinnedNotes()), so
   there's no separate hidden/visible state to track here.
   Background/border follow the user's selected Chat Bubble theme (same
   --friend-chat-bubble-bg mechanism as .friend-chat-message, plus a
   --friend-chat-bubble-border solid color for the border - see
   applyChatAppearance() in friends.js) so the note matches the chosen
   theme; #1a1400/var(--renegade-accent) below are just the fallback for
   when no theme is selected, same as the previous look. Text stays a
   fixed white/light color regardless of theme so it stays readable on
   every preset. */
.friend-chat-pinned-note {
    display: flex;
    flex-direction: column;
    background-color: #1a1400;
    background-image: var(--friend-chat-bubble-bg, none);
    border: 1px solid var(--friend-chat-bubble-border, var(--renegade-accent));
    border-radius: 8px;
    padding: 8px 10px;
    margin-top: 8px;
    box-sizing: border-box;
}

.friend-chat-pinned-notes .friend-chat-pinned-note {
    margin-top: 0;
}

.friend-chat-pinned-note-header {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.friend-chat-pinned-note-icon {
    flex-shrink: 0;
    color: #fff;
    font-size: 14px;
}

.friend-chat-pinned-note-summary {
    flex: 1;
    min-width: 0;
}

.friend-chat-pinned-note-title {
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-chat-pinned-note-meta {
    color: #999;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-chat-pinned-note-chevron {
    flex-shrink: 0;
    color: #999;
    font-size: 11px;
    transition: transform 0.15s ease;
}

.friend-chat-pinned-note.expanded .friend-chat-pinned-note-chevron {
    transform: rotate(180deg);
}

.friend-chat-pinned-note-delete-btn {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #999;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 4px;
}

.friend-chat-pinned-note-delete-btn:hover {
    color: #ff6b6b;
}

.friend-chat-pinned-note-body {
    display: none;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(var(--renegade-accent-rgb), 0.25);
    color: #ddd;
    font-size: 13px;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 160px;
    overflow-y: auto;
}

.friend-chat-pinned-note.expanded .friend-chat-pinned-note-body {
    display: block;
}

/* Note composer - an in-panel overlay opened from the "+" attach menu.
   .friend-chat-panel is (via .renegade-modal-panel) position:fixed, which
   is itself a containing block for position:absolute descendants, so this
   covers just the chat panel rather than the whole screen. */
.friend-chat-note-composer {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 30;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.75);
    border-radius: inherit;
}

.friend-chat-note-composer.open {
    display: flex;
}

.friend-chat-note-composer-card {
    width: 100%;
    max-width: 320px;
    background-color: #141414;
    border: 1px solid var(--renegade-accent);
    border-radius: 12px;
    padding: 18px;
    box-sizing: border-box;
}

.friend-chat-note-composer-title {
    color: var(--renegade-accent);
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 12px;
}

.friend-chat-note-title-input,
.friend-chat-note-body-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background-color: #0a0a0a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    margin-bottom: 6px;
}

.friend-chat-note-body-input {
    resize: vertical;
    min-height: 90px;
}

.friend-chat-note-char-count {
    text-align: right;
    color: #888;
    font-size: 11px;
    margin-bottom: 10px;
}

.friend-chat-note-error {
    display: none;
    color: #ff6b6b;
    font-size: 12px;
    margin-bottom: 8px;
}

.friend-chat-note-composer-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.friend-chat-note-cancel-btn,
.friend-chat-note-post-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
}

.friend-chat-note-cancel-btn {
    background: none;
    border: 1px solid #444;
    color: #ccc;
}

.friend-chat-note-post-btn {
    background-color: #1F1F1F;
    border: 1px solid var(--renegade-accent);
    color: var(--renegade-accent);
}

.friend-chat-note-post-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

/* Delete/unpin control for the note composer - only shown while editing
   an existing note (see openNoteComposer). margin-right: auto keeps it
   pinned to the left of the actions row while Cancel/Save stay on the
   right via the row's existing justify-content: flex-end. */
.friend-chat-note-delete-btn {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    cursor: pointer;
    background: none;
    border: 1px solid #663333;
    color: #ff6b6b;
    margin-right: auto;
}

.friend-chat-note-delete-btn:hover {
    background-color: rgba(255, 107, 107, 0.1);
}

.friend-chat-note-delete-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.friend-chat-title-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    
    flex: 1;
}

.friend-chat-title {
    margin: 0;
    text-align: left;
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.friend-chat-titlebar-controls {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.friend-chat-settings-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 20;
    width: 220px;
    max-height: 320px;
    overflow-y: auto;
    background-color: #000000;
    border: 1px solid var(--renegade-accent);
    border-radius: 10px;
    padding: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.friend-chat-settings-dropdown.open {
    display: block;
}

.friend-chat-settings-section-title {
    color: var(--renegade-accent);
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: 4px 0;
}

.friend-chat-settings-menu-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 8px 12px;
    margin-bottom: 6px;
    background: #111;
    color: #ccc;
    border: 1px solid #444;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
}

.friend-chat-settings-menu-btn:hover {
    border-color: var(--renegade-accent);
    color: var(--renegade-accent);
}

.friend-chat-settings-menu-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.friend-chat-settings-menu-btn-danger {
    margin-top: 4px;
    border-color: rgba(255, 59, 59, 0.4);
    color: #ff6b6b;
}

.friend-chat-settings-menu-btn-danger:hover {
    border-color: #ff3b3b;
    color: #ff3b3b;
}

.friend-chat-input:disabled,
.friend-chat-attach-btn:disabled,
.friend-chat-mic-btn:disabled,
.friend-chat-send-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.friend-chat-settings-back-btn {
    display: block;
    background: none;
    border: none;
    color: var(--renegade-accent);
    cursor: pointer;
    font-size: 12px;
    padding: 0 0 8px 0;
    text-align: left;
}

.friend-chat-settings-back-btn:hover {
    text-decoration: underline;
}

.friend-chat-settings-empty {
    color: #888;
    font-size: 12px;
    font-style: italic;
    padding: 6px 2px;
}

.chat-appearance-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.chat-appearance-swatch {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
    padding: 0;
    background: #111;
    border: 2px solid #444;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
}

.chat-appearance-swatch:hover {
    border-color: var(--renegade-accent);
}

.chat-appearance-swatch.selected {
    border-color: var(--renegade-accent);
    box-shadow: 0 0 0 1px var(--renegade-accent);
}

.chat-appearance-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chat-appearance-swatch-default {
    color: #ccc;
    font-size: 11px;
    text-align: center;
    padding: 4px;
}

.chat-appearance-swatch-default.selected {
    color: var(--renegade-accent);
}

.friend-chat-messages {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    /* Stops this list's own scroll from "chaining" into whatever contains
       it once you hit the top/bottom edge (the classic momentum-scroll
       overshoot that drags a fixed titlebar along with it) - the sticky
       titlebar above is the primary fix, this closes the other half of
       the same complaint. */
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;

    gap: 12px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    background-color: #0a0a0a;
    
    background-image: var(--friend-chat-bg-image, none);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.friend-chat-message {
    position: relative;
    max-width: 70%;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
    white-space: pre-wrap;
    
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
    
    background-image: var(--friend-chat-bubble-bg, none);
}

.friend-chat-message-own {
    align-self: flex-end;
    background-color: var(--renegade-accent);
    color: #000;
    border-bottom-right-radius: 3px;
}

.friend-chat-message-theirs {
    align-self: flex-start;
    background-color: #1c1c1c;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-bottom-left-radius: 3px;
}

.friend-chat-message-edited-tag {
    display: none;
    font-size: 10px;
    font-style: italic;
    opacity: 0.6;
}

.friend-chat-message-reaction-badge {
    display: none;
    position: absolute;
    bottom: -9px;
    align-items: center;
    justify-content: center;
    width: 21px;
    height: 21px;
    font-size: 18px;
    line-height: 1;
    pointer-events: none;
}

.friend-chat-message-own .friend-chat-message-reaction-badge {
    left: -9px;
}

.friend-chat-message-theirs .friend-chat-message-reaction-badge {
    right: -9px;
}

.friend-chat-message-menu-emojis {
    position: fixed;
    display: flex;
    gap: 2px;
    padding: 4px;
    background-color: #111111;
    border: 1px solid var(--renegade-accent);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    z-index: 20000;
    white-space: nowrap;
}

.friend-chat-message-menu-emoji-option {
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    background: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s ease, background-color 0.1s ease;
}

.friend-chat-message-menu-emoji-option:hover {
    background-color: rgba(255, 255, 255, 0.12);
    transform: scale(1.15);
}

.friend-chat-message-menu-actions {
    position: fixed;
    display: flex;
    gap: 6px;
    z-index: 20000;
    white-space: nowrap;
}

.friend-chat-message-menu-action-btn {
    padding: 3px 9px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 10px;
    line-height: 1.4;
    white-space: nowrap;
}

.friend-chat-message-menu-open {
    z-index: 10;
}

.friend-chat-message-system {
    align-self: center;
    max-width: 85%;
    text-align: center;
    color: #888;
    font-size: 11px;
    font-style: italic;
    padding: 2px 10px;
}

/* Call-lifecycle notes (answered / declined / ended / hung up) are shown
   as pills, matching the admin area's status-pill look (.admin-dns-status-
   pill) rather than plain italic system text. */
.friend-chat-message-system-call {
    display: inline-flex;
    align-self: center;
    align-items: center;
    max-width: 85%;
    font-style: normal;
    font-weight: bold;
    font-size: 11px;
    letter-spacing: 0.3px;
    padding: 3px 12px;
    border-radius: 10px;
    white-space: normal;
}

.friend-chat-message-system-call.answered {
    color: #39ff14;
    background-color: rgba(57, 255, 20, 0.1);
    border: 1px solid rgba(57, 255, 20, 0.4);
}

.friend-chat-message-system-call.ended {
    color: #ff5c5c;
    background-color: rgba(255, 92, 92, 0.1);
    border: 1px solid rgba(255, 92, 92, 0.4);
}

/* a call that ended unexpectedly (dropped / couldn't connect) - stands out from a normal "Call ended." */
.friend-chat-message-system-call.ended.dropped {
    color: #ffffff;
    background-color: #d92626;
    border: 1px solid #ff5c5c;
    box-shadow: 0 0 8px rgba(255, 60, 60, 0.45);
}

.friend-chat-input-row {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin-top: 10px;
    flex-shrink: 0;
}

/* File-upload progress bar, shown above the input row while
   sendChatAttachments() is uploading (see friends.js
   setUploadProgress()/hideUploadProgress()). */
.friend-chat-upload-progress {
    flex-shrink: 0;
    margin-top: 10px;
}

.friend-chat-upload-progress-track {
    width: 100%;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
}

.friend-chat-upload-progress-bar {
    height: 100%;
    width: 0%;
    background-color: var(--renegade-accent);
    border-radius: 2px;
    transition: width 0.15s ease;
}

.friend-chat-upload-progress-label {
    margin-top: 4px;
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.friend-chat-input {
    flex: 1;
    padding: 10px 12px;
    background-color: #111111;
    color: #fff;
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    font-size: 13px;
    font-family: inherit;
    box-sizing: border-box;
    
    resize: none;
    overflow-y: auto;
    line-height: 1.4;
    max-height: 140px;
}

.friend-chat-input:focus {
    outline: none;
    box-shadow: 0 0 0 1px var(--renegade-accent);
}

.friend-chat-send-btn {
    padding: 10px 16px;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
}

.friend-chat-send-btn:hover {
    background-color: #222222;
}

.friend-chat-messages-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.friend-chat-messages-wrap .friend-chat-messages {
    flex: 1;
}

.friend-chat-typing-indicator {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translate(-50%, 6px);
    background-color: rgba(0, 0, 0, 0.85);
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 999px;
    padding: 4px 14px;
    font-size: 11px;
    font-style: italic;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.friend-chat-typing-indicator.friend-chat-typing-indicator-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.friend-chat-message-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.friend-chat-message-quote {
    display: block;
    padding: 2px 0 4px 8px;
    margin-bottom: 4px;
    border-left: 2px solid currentColor;
    opacity: 0.6;
    font-size: 12px;
    font-style: italic;
    white-space: pre-wrap;
    word-break: break-word;
}


.installed-game-invite-actions {
    margin-top: 6px;
}

.installed-game-invite-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background-color: #1a1a1a;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.installed-game-invite-btn:hover {
    background-color: #262626;
}

.friend-chat-message-receipt {
    margin-top: 4px;
    font-size: 10px;
    text-align: right;
    opacity: 0.55;
}

.friend-chat-message-receipt.friend-chat-message-receipt-read {
    opacity: 0.9;
    font-weight: bold;
}

.friend-chat-attachment-image-link {
    display: block;
    margin-top: 6px;
}

.friend-chat-attachment-image {
    display: block;
    max-width: 220px;
    max-height: 220px;
    border-radius: 8px;
    object-fit: cover;
}

.friend-chat-attachment-file {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    color: inherit;
    text-decoration: underline;
    font-size: 12px;
    word-break: break-all;
}

.friend-chat-attach-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
}

.friend-chat-attach-btn:hover {
    background-color: #222222;
}

.friend-chat-attach-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.friend-chat-restore-pill {
    display: none;
    align-items: center;
    gap: 6px;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.friend-chat-restore-pill:hover {
    background-color: #222222;
}

.friend-chat-restore-pill-pulse {
    animation: friendChatRestorePillPulse 1.4s ease-in-out infinite;
}

@keyframes friendChatRestorePillPulse {
    0%, 100% {
        border-color: #39ff14;
        box-shadow: 0 0 0 0 rgba(57, 255, 20, 0.55), 0 8px 20px rgba(0, 0, 0, 0.5);
    }
    50% {
        border-color: #39ff14;
        box-shadow: 0 0 0 8px rgba(57, 255, 20, 0), 0 8px 20px rgba(0, 0, 0, 0.5);
    }
}

.renegade-call-panel {
    width: 300px;
    max-width: 88vw;
    height: 67vh;
    max-height: 620px;
    padding: 0;
    border-width: 2px;
    border-radius: 28px;
    overflow: hidden;
    display: none;
    flex-direction: column;
    background-color: #050505;
}

.renegade-call-panel.open {
    display: flex !important;
}

.rc-titlebar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    padding: 8px 8px 0 8px;
    flex-shrink: 0;
    position: relative;
    z-index: 3;
}

.rc-control-btn {
    width: 26px;
    height: 26px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(17, 17, 17, 0.85);
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.rc-control-btn:hover {
    background-color: #222222;
}

.rc-control-btn-close {
    color: #ff6b6b;
    border-color: #ff6b6b;
}

.rc-control-btn-close:hover {
    background-color: rgba(255, 107, 107, 0.15);
}

.rc-remote-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    background: radial-gradient(circle at 50% 32%, #1a1a1a, #000000 72%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.rc-remote-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background-color: #000;
}

.rc-avatar-fallback {
    position: relative;
    width: 96px;
    height: 96px;
    border-radius: 50%;
    background-color: #111111;
    border: 3px solid var(--renegade-accent);
    color: var(--renegade-accent);
    font-size: 38px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.rc-avatar-img {
    display: none;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    z-index: 1;
}

.rc-avatar-letter {
    position: relative;
}

.rc-info {
    position: absolute;
    top: 14px;
    left: 0;
    right: 0;
    text-align: center;
    color: #fff;
    z-index: 2;
    pointer-events: none;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

.rc-username {
    font-size: 16px;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 12px;
}

.rc-status {
    font-size: 12px;
    color: var(--renegade-accent);
    margin-top: 2px;
}

.rc-local-video {
    position: absolute;
    right: 10px;
    bottom: 10px;
    width: 68px;
    height: 96px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--renegade-accent);
    background-color: #000;
    z-index: 2;
}

.rc-actions {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px 10px 16px 10px;
    flex-shrink: 0;
}

.rc-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    background-color: #1c1c1c;
    color: #fff;
}

.rc-btn:hover {
    filter: brightness(1.2);
}

.rc-btn-secondary {
    background-color: #1c1c1c;
    color: var(--renegade-accent);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.rc-btn-secondary.rc-btn-active {
    background-color: var(--renegade-accent);
    color: #000;
    border-color: var(--renegade-accent);
}

.rc-btn-accept {
    width: 44px;
    height: 44px;
    font-size: 18px;
    background-color: #39ff14;
    color: #000;
}

.rc-btn-decline {
    background-color: #ff3b30;
    color: #fff;
}

.rc-btn-hangup {
    width: 44px;
    height: 44px;
    font-size: 18px;
    transform: rotate(135deg);
}

.renegade-call-restore-pill {
    display: none;
    align-items: center;
    gap: 6px;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.renegade-call-restore-pill:hover {
    background-color: #222222;
}

.console-panel {
    
    width: calc(50vw - 120px);
    max-width: calc(50vw - 120px);
    max-height: 70vh;
    display: none;
    flex-direction: column;
}

.console-panel.open {
    display: flex !important;
}

.console-panel-toolbar {
    flex-shrink: 0;
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.console-panel-log {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    background-color: #050505;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 8px;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 11px;
    line-height: 1.5;
}

.console-panel-line {
    display: flex;
    gap: 8px;
    padding: 2px 0;
    border-bottom: 1px solid #1a1a1a;
    white-space: pre-wrap;
    word-break: break-word;
}

.console-panel-line-time {
    flex-shrink: 0;
    color: #666;
}

.console-panel-line-message {
    min-width: 0;
    color: #ccc;
}

.console-panel-line-warn .console-panel-line-message {
    color: #e8c14a;
}

.console-panel-line-error .console-panel-line-message {
    color: #ff6b6b;
}

.console-panel-line-info .console-panel-line-message {
    color: var(--renegade-accent);
}

.console-panel-empty {
    padding: 14px 4px;
    font-size: 12px;
    color: #999;
    text-align: center;
}

.login-status {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    opacity: 0;
    transition: max-height 0.2s ease, opacity 0.2s ease, margin 0.2s ease;
}

.login-status.visible {
    max-height: 160px;
    margin: 8px 0 10px 0;
    opacity: 1;
}

.login-status-avatar-wrap {
    position: relative;
    width: 64px;
    height: 64px;
    max-width: 120px;
    max-height: 120px;
}

.login-status-avatar-wrap-clickable {
    cursor: pointer;
}

.login-status-avatar {
    width: 100%;
    height: 100%;
    max-width: 120px;
    max-height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--renegade-accent);
    display: block;
    background-color: #111111;
}

.login-status-online-dot {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #666;
    border: 2px solid #000;
    box-sizing: content-box;
}

.login-status-online-dot.online {
    background-color: #39ff14;
    box-shadow: 0 0 4px #39ff14;
}

.login-status-name {
    color: var(--renegade-accent);
    font-size: 12px;
    font-weight: bold;
    max-width: 110px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.login-status-admin-badge {
    color: #ffb347;
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.login-status-badge-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
}

.login-status-plan-badge {
    font-size: 10px;
    font-weight: bold;
    letter-spacing: 0.5px;
}

.login-status-plan-badge.tier-none {
    color: #999;
}

.login-status-plan-badge.tier-basic {
    color: var(--renegade-accent);
}

.login-status-plan-badge.tier-pro {
    color: #ffb347;
}

.admin-panel {
    top: 20vh;

    bottom: calc(13vh - 40px);
    left: 14vw;
    right: 14vw;
    transform: none;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    overflow: hidden;
    display: none;
}

.admin-panel.open {
    display: flex !important;
    flex-direction: column;
}

.admin-panel .renegade-modal-title {
    flex-shrink: 0;
}

.admin-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    gap: 16px;
}

.admin-nav {
    flex: 0 0 170px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 14px;
    border-right: 1px solid #333;
    overflow-y: auto;
}

.admin-nav-tab {
    width: 100%;
    text-align: left;
    padding: 8px 10px;
    background: none;
    border: 1px solid #444;
    color: #ccc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
}

.admin-nav-tab:hover {
    border-color: var(--renegade-accent);
    color: var(--renegade-accent);
}

.admin-nav-tab.active {
    background-color: rgba(var(--renegade-accent-rgb), 0.12);
    border-color: var(--renegade-accent);
    color: var(--renegade-accent);
    font-weight: bold;
}

.admin-content {
    flex: 1 1 auto;
    min-width: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.admin-content-narrow {
    /* Was a flat 25% of .admin-content, which made these sections' width
       swing wildly with the admin panel's own size (via .admin-panel's
       viewport-relative left/right) instead of just being "a bit narrower
       than full width" - on a smaller panel that left the AI Servers /
       Payments cards squeezed into a sliver with a huge blank gap next to
       them. A capped max-width keeps the form-style content comfortably
       narrow without being proportional to (and breaking with) the
       panel's own width. */
    width: 100%;
    max-width: 640px;
}

.admin-console-section {
    /* .console-panel-log below already brings its own flex:1 1 auto;
       min-height:0; overflow-y:auto (it's normally the floating Console
       panel's log, reused here - see console-panel.js's RenegadeConsole.
       renderInto()); this just gives it a flex-column parent with a bounded
       height to grow into, the same way .console-panel itself does. */
    display: flex;
    flex-direction: column;
    height: 65vh;
}

.admin-pc-stats-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.admin-pc-stat {
    flex: 1 1 160px;
    /* Without this, a flex item's default min-width is "auto" (its own
       content's natural width), not 0 - so on a narrow admin panel this
       tile would refuse to shrink past that and force the row to overflow
       instead of wrapping/shrinking cleanly. */
    min-width: 0;
    background-color: #0d0d0d;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px 12px;
    box-sizing: border-box;
}

.admin-pc-stat-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 11px;
    color: #999;
    margin-bottom: 6px;
}

.admin-pc-stat-value {
    font-size: 12px;
    font-weight: bold;
    color: var(--renegade-accent);
}

/* Colors the value text (which includes the temperature reading) when a
   CPU/GPU is running hot - independent of the usage bar below it, which
   stays keyed to utilization% rather than temperature. */
.admin-pc-stat-value.temp-warn {
    color: #ffb347;
}

.admin-pc-stat-value.temp-critical {
    color: #ff6b6b;
}

.admin-pc-stat-bar-track {
    height: 6px;
    border-radius: 3px;
    background-color: #222;
    overflow: hidden;
}

.admin-pc-stat-bar-fill {
    height: 100%;
    background-color: var(--renegade-accent);
    transition: width 0.4s ease;
}

.admin-pc-stat-bar-fill.warn {
    background-color: #ffb347;
}

.admin-pc-stat-bar-fill.critical {
    background-color: #ff6b6b;
}

.admin-section {
    border-top: 1px solid #333;
    padding-top: 14px;
    margin-top: 14px;
}

.admin-section:first-of-type {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.admin-section-title {
    color: var(--renegade-accent);
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 10px;
}

.admin-section-hint {
    color: #999;
    font-size: 12px;
    line-height: 1.4;
    margin-bottom: 12px;
}

.admin-server-bar {
    background-color: #0d0d0d;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 12px;
}

.admin-server-heading {
    color: var(--renegade-accent);
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 6px;
}

.admin-user-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #999;
    font-size: 12px;
}

.admin-user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 8px 10px;
    background-color: #111111;
}

.admin-user-meta {
    min-width: 0;
    flex: 1;
}

.admin-user-name {
    color: var(--renegade-accent);
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.admin-user-detail {
    color: #999;
    font-size: 11px;
    margin-top: 2px;
    text-transform: capitalize;
}

.admin-user-actions .account-panel-button {
    font-size: 11px;
    padding: 6px 10px;
    width: auto;
}

.admin-user-actions .account-panel-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.admin-user-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}

.admin-user-badge {
    font-size: 10px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
    text-transform: none;
}

.admin-user-badge.tier-none {
    color: #999;
    background-color: rgba(153, 153, 153, 0.12);
    border: 1px solid rgba(153, 153, 153, 0.4);
}

.admin-user-badge.tier-basic {
    color: var(--renegade-accent);
    background-color: rgba(var(--renegade-accent-rgb), 0.12);
    border: 1px solid rgba(var(--renegade-accent-rgb), 0.4);
}

.admin-user-badge.tier-pro {
    color: #ffb347;
    background-color: rgba(255, 179, 71, 0.14);
    border: 1px solid rgba(255, 179, 71, 0.45);
}

.admin-user-badge.usage-badge {
    color: #999;
    background-color: rgba(153, 153, 153, 0.08);
    border: 1px solid rgba(153, 153, 153, 0.3);
}

.admin-user-badge.banned-badge {
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.4);
}

.admin-content-resizable {
    display: flex;
    align-items: stretch;
    min-width: 320px;
    max-width: 100%;
    flex: 0 0 auto;
}

.admin-content-resizable-inner {
    flex: 1 1 auto;
    min-width: 0;
    overflow-y: auto;
    padding-right: 4px;
}

.admin-content-resize-handle {
    flex: 0 0 8px;
    margin-left: 4px;
    cursor: ew-resize;
    border-radius: 4px;
    background-color: #222;
    position: relative;
}

.admin-content-resize-handle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 28px;
    background-color: #555;
    border-radius: 1px;
}

.admin-content-resize-handle:hover,
.admin-content-resize-handle:active {
    background-color: rgba(var(--renegade-accent-rgb), 0.25);
}

.admin-content-resize-handle:hover::after,
.admin-content-resize-handle:active::after {
    background-color: var(--renegade-accent);
}

.admin-payments-hint {
    margin-bottom: 12px;
}

.admin-payments-preview {
    color: #999;
    font-size: 11px;
    margin-top: 4px;
    word-break: break-all;
}

.admin-payments-enabled-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    color: #ddd;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.admin-payments-enabled-row input[type="checkbox"] {
    accent-color: var(--renegade-accent);
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.admin-payments-enabled-note {
    margin-bottom: 16px;
    font-size: 11px;
    color: #888;
}

.admin-service-refresh-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.admin-service-refresh-row .account-panel-button {
    font-size: 11px;
    padding: 6px 10px;
    width: auto;
}

.admin-service-bulk-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #333;
}

.admin-service-bulk-row .account-panel-button {
    font-size: 11px;
    padding: 6px 10px;
    width: auto;
}

.admin-service-bulk-row .account-panel-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.admin-service-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-service-card {
    background-color: #0d0d0d;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px;
}

.admin-service-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
}

.admin-service-name {
    color: var(--renegade-accent);
    font-size: 13px;
    font-weight: bold;
}

.admin-service-status {
    font-size: 11px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.admin-service-status.running {
    color: #7cfc7c;
    background-color: rgba(124, 252, 124, 0.12);
    border: 1px solid rgba(124, 252, 124, 0.4);
}

.admin-service-status.stopped {
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.4);
}

.admin-service-status.unknown {
    color: #999;
    background-color: rgba(153, 153, 153, 0.12);
    border: 1px solid rgba(153, 153, 153, 0.4);
}

.admin-service-detail {
    color: #999;
    font-size: 11px;
    margin-bottom: 8px;
}

.admin-service-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.admin-service-actions .account-panel-button {
    font-size: 11px;
    padding: 6px 10px;
    width: auto;
}

.admin-service-actions .account-panel-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.admin-service-note {
    color: #777;
    font-size: 11px;
    margin-top: 4px;
    font-style: italic;
}

.admin-dependency-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.admin-dependency-item {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 10px;
    border: 1px solid #444;
    color: #999;
}

.admin-dependency-item.ok {
    color: #7cfc7c;
    border-color: rgba(124, 252, 124, 0.4);
}

.admin-dependency-item.missing {
    color: #ff6b6b;
    border-color: rgba(255, 107, 107, 0.4);
}

.admin-dns-form {
    width: 55%;
    min-width: 340px;
    max-width: 620px;
}

.admin-dns-status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 16px;
    background-color: #0d0d0d;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.admin-dns-status-left {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.admin-dns-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.3px;
    padding: 3px 10px 3px 8px;
    border-radius: 10px;
    white-space: nowrap;
}

.admin-dns-status-pill::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: currentColor;
}

.admin-dns-status-pill.online {
    color: #39ff14;
    background-color: rgba(57, 255, 20, 0.1);
    border: 1px solid rgba(57, 255, 20, 0.4);
}

.admin-dns-status-pill.online::before {
    box-shadow: 0 0 5px #39ff14;
}

.admin-dns-status-pill.offline {
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.4);
}

.admin-dns-status-pill.checking {
    color: #999;
    background-color: rgba(153, 153, 153, 0.12);
    border: 1px solid rgba(153, 153, 153, 0.4);
}

.admin-dns-ip {
    font-size: 12px;
    color: #999;
    font-family: "Courier New", Courier, monospace;
    white-space: nowrap;
}

.admin-dns-ip-value {
    font-weight: bold;
    color: #ccc;
}

.admin-dns-ip-value.live {
    color: #39ff14;
    text-shadow: 0 0 6px rgba(57, 255, 20, 0.45);
}

.admin-dns-ip-value.error {
    color: #ff6b6b;
}

.admin-dns-message {
    font-size: 11px;
    color: #999;
    margin-bottom: 14px;
    padding: 0 2px;
}

.admin-dns-card {
    background-color: #0d0d0d;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 12px;
}

.admin-update-card {
    max-width: 620px;
    text-align: center;
}

.admin-update-current-version {
    display: block;
    width: fit-content;
    margin: 0 auto 16px auto;
    padding: 3px 10px 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.3px;
    white-space: nowrap;
    color: #39ff14;
    background-color: rgba(57, 255, 20, 0.1);
    border: 1px solid rgba(57, 255, 20, 0.4);
}

/* The Windows version pill sits right under the Update Android button - this
   gives it room above (the base rule above only has margin-bottom), so the
   Android and Windows groups don't touch. Must stay after
   .admin-update-current-version so its margin-top wins. */
.admin-update-windows-version {
    margin-top: 24px;
}

.admin-update-current-version.loading {
    color: #999;
    background-color: rgba(153, 153, 153, 0.12);
    border: 1px solid rgba(153, 153, 153, 0.4);
}

.admin-update-current-version.error {
    color: #ff6b6b;
    background-color: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.4);
}

.admin-update-status-pill {
    /* .account-panel-button above it is width:100%, so this inline-flex
       pill always wraps onto its own line below the button - but with no
       margin-top it sat flush against the button's bottom edge with zero
       gap. Matches the 16px spacing used everywhere else in this panel
       (the current-version pill's margin-bottom, the progress track's
       margin-top/bottom, etc.) */
    margin-top: 16px;
    margin-left: 10px;
    margin-bottom: 16px;
}

/* Holds "Show/Hide error log" and "Copy" side by side, evenly spaced and
   the same height - both buttons only take the width their label needs
   (see the descendant rule below, which beats .account-panel-button's
   own "width: 100%" via the extra class in the selector, regardless of
   which one is defined later in this file). */
.admin-update-log-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.admin-update-log-actions .account-panel-button {
    width: auto;
    flex: 0 0 auto;
    padding: 8px 14px;
    font-size: 12px;
}

.admin-update-log {
    text-align: left;
}

.admin-update-progress-track {
    margin-top: 16px;
    margin-bottom: 16px;
    height: 18px;
    background-color: #000;
    border: 1px solid #333;
    border-radius: 9px;
    overflow: hidden;
}

.admin-update-progress-fill {
    height: 100%;
    width: 0%;
    min-width: 28px;
    background: linear-gradient(90deg, #3a7bd5, #5ea0ff);
    color: #fff;
    font-size: 10px;
    font-weight: 600;
    line-height: 18px;
    text-align: right;
    padding-right: 6px;
    box-sizing: border-box;
    white-space: nowrap;
    transition: width 0.4s ease;
}

.admin-update-log {
    display: block;
    margin-top: 16px;
    max-height: 320px;
    overflow: auto;
    background-color: #000;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 10px 12px;
    font-family: "Courier New", Courier, monospace;
    font-size: 11px;
    line-height: 1.4;
    color: #ccc;
    white-space: pre-wrap;
    word-break: break-word;
}

.admin-dns-checkbox-row {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: #ccc;
    margin-top: 2px;
}

.admin-dns-checkbox-row input[type="checkbox"] {
    accent-color: var(--renegade-accent);
    width: 14px;
    height: 14px;
    cursor: pointer;
}

.admin-dns-actions {
    justify-content: flex-end;
}

.admin-server-row {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: 12px;
}

.admin-server-row:last-child {
    margin-bottom: 0;
}

.admin-server-row label {
    font-size: 10px;
    font-weight: bold;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.admin-server-hint {
    font-size: 11px;
    color: #999;
}

.account-input {
    width: 100%;
    padding: 9px 10px;
    background-color: #111111;
    color: #eee;
    border: 1px solid #444;
    border-radius: 6px;
    font-size: 13px;
    box-sizing: border-box;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

select.account-input {
    cursor: pointer;
}

.account-input:focus {
    outline: none;
    border-color: var(--renegade-accent);
    box-shadow: 0 0 0 2px rgba(var(--renegade-accent-rgb), 0.15);
}

.account-input:disabled {
    opacity: 0.6;
}

.image-panel {
    top: 20vh;
    
    bottom: calc(13vh - 40px);
    left: 14vw;
    right: 14vw;
    transform: none;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    overflow: hidden;
    display: none;
}

.image-panel.open {
    display: flex !important;
    flex-direction: column;
}

.image-panel .renegade-modal-title {
    flex-shrink: 0;
}

.coding-panel,
.video-panel,
.subscription-panel,
.uno-panel,
.friend-chat-panel,
.chat-panel,
.feed-panel {
    top: 20vh;
    left: 14vw;
    right: 14vw;
    transform: none;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    overflow: hidden;
    display: none;
}

.uno-panel {
    bottom: 13vh;
}

.coding-panel,
.video-panel,
.chat-panel,
.subscription-panel,
.friend-chat-panel {
    bottom: calc(13vh - 40px);
}


.feed-panel {
    bottom: 40px;
}

.video-panel .admin-nav {
    flex: 0 0 148px;
}

.coding-panel.open,
.video-panel.open,
.subscription-panel.open,
.uno-panel.open,
.friend-chat-panel.open,
.chat-panel.open,
.feed-panel.open {
    display: flex !important;
    flex-direction: column;
}

.coding-panel .renegade-modal-title,
.video-panel .renegade-modal-title,
.subscription-panel .renegade-modal-title,
.uno-panel .renegade-modal-title,
.friend-chat-panel .renegade-modal-title,
.chat-panel .renegade-modal-title {
    flex-shrink: 0;
}

.chat-panel-nav {
    flex: 0 0 190px;
    scrollbar-width: none; 
    -ms-overflow-style: none; 
}

.chat-panel-nav::-webkit-scrollbar {
    display: none; 
}

.chat-panel-nav .file-panel-title,
.chat-panel-nav #history-list,
.chat-panel-nav .history-listbox {
    width: 100% !important;
}

.chat-panel-nav #files-section {
    width: 100% !important;
    margin-top: 14px !important;
}

.chat-panel-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    padding-right: 0;
}

.chat-panel-content #chat-window {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
}

#chat-panel-close-btn {
    display: none;
}

.chat-panel-mobile-toolbar {
    display: none;
    flex-shrink: 0;
}

.chat-mobile-toolbar-btn {
    padding: 8px 10px;
    background: none;
    border: 1px solid #444;
    color: #ccc;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    list-style: none;
}

.chat-mobile-toolbar-btn::-webkit-details-marker {
    display: none;
}

.chat-mobile-toolbar-btn:hover {
    border-color: var(--renegade-accent);
    color: var(--renegade-accent);
}

.chat-mobile-dropdown[open] > .chat-mobile-toolbar-btn {
    border-color: var(--renegade-accent);
    color: var(--renegade-accent);
    font-weight: bold;
}

.chat-mobile-dropdown {
    position: relative;
}

.chat-mobile-dropdown > #history-list,
.chat-mobile-dropdown > #files-section {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 20;
    background-color: #111111;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    width: 260px !important;
    max-width: 80vw;
    max-height: 40vh;
    overflow-y: auto;
    margin-top: 0 !important;
}

.uno-panel-iframe {
    flex: 1;
    width: 100%;
    min-height: 0;
    border: 0;
    border-radius: 8px;
    background: #090d14;
}

.uno-panel-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
    margin-bottom: 10px;
}

.uno-panel-title {
    margin: 0;
    text-align: left;
}

.uno-panel-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.uno-panel-control-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;

    /* Without this, mobile WebKit/WebView paints its own native button
       chrome (a grey gradient/highlight) on top of whatever background and
       icon this button has - invisible on desktop Chrome, which doesn't
       apply that default styling, but exactly the "fine on desktop, grey
       on mobile" overlay reported here. */
    -webkit-appearance: none;
    appearance: none;
    background-clip: padding-box;
}

.uno-panel-control-btn:hover {
    background-color: #222222;
}

/* Green matches the app's existing "online"/answer color
   (friendAvatarPulseGreen's #39ff14) rather than introducing a new one. */
#friend-chat-call-btn {
    color: #39ff14 !important;
}

#friend-chat-call-btn:hover {
    background-color: rgba(57, 255, 20, 0.15) !important;
}

.uno-panel-close-btn {
    color: #ff6b6b;
    border-color: #ff6b6b;
}

.uno-panel-close-btn:hover {
    background-color: rgba(255, 107, 107, 0.15);
}

.panel-chrome-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
}

.panel-chrome-controls {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.panel-chrome-fullscreen {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    transform: none !important;
    z-index: 10000 !important;
}

.panel-chrome-restore-pill {
    display: none;
    align-items: center;
    gap: 6px;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.panel-chrome-restore-pill:hover {
    background-color: #222222;
}

.uno-panel.uno-panel-fullscreen {
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    max-width: none !important;
    max-height: none !important;
    border-radius: 0 !important;
    transform: none !important;
    z-index: 10000 !important;
}

/* UNO always fills the screen (games.js enterUnoFullscreen): no frame, no padding, no title bar. */
.uno-panel.uno-panel-fullscreen {
    padding: 0 !important;
    border: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    overflow: hidden !important;
    background: #090d14 !important;
    position: fixed !important;
}

.uno-panel.uno-panel-fullscreen .uno-panel-iframe {
    border-radius: 0;
}

.uno-panel .uno-panel-titlebar[hidden] {
    display: none !important;
}

/* The only way out now that the title bar is gone: a small – / ✕ in the top corner. */
.uno-panel-float-controls {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 5;
    display: flex;
    gap: 6px;
    opacity: 0.55;
    transition: opacity 0.15s;
}

.uno-panel-float-controls:hover,
.uno-panel-float-controls:focus-within {
    opacity: 1;
}

.uno-panel-float-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.35);
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.uno-panel-float-close:hover {
    color: #ff6b6b;
    border-color: #ff6b6b;
}

/* Phone held upright and the screen can't be locked to landscape: turn the game sideways.
   games.js sets the iframe's width to the screen height and its height to the screen width. */
.uno-panel.uno-panel-rotated .uno-panel-iframe {
    position: absolute;
    top: 0;
    left: 0;
    flex: none;
    max-width: none;
    max-height: none;
    transform-origin: top left;
    transform: rotate(90deg) translateY(-100%);
}

/* Turned sideways: the corner that looks like "top right" to the player is the screen's bottom
   right, and the buttons are turned with the game. */
.uno-panel.uno-panel-rotated .uno-panel-float-controls {
    top: auto;
    bottom: 40px;
    right: 6px;
    /* turning around the bottom-right corner swings the 30px-tall row off the edge; shift it back */
    transform: translateX(-32px) rotate(90deg);
    transform-origin: bottom right;
}

.uno-restore-pill {
    display: none;
    align-items: center;
    gap: 6px;
    position: fixed;
    right: 20px;
    bottom: 20px;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.uno-restore-pill:hover {
    background-color: #222222;
}

.admin-nav-tab-static {
    cursor: default;
}

.subscription-panel-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.subscription-banned-banner {
    background-color: rgba(255, 107, 107, 0.12);
    border: 1px solid rgba(255, 107, 107, 0.5);
    color: #ff9b9b;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 13px;
    line-height: 1.5;
}

.subscription-status-card {
    background-color: #0d0d0d;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 14px;
    color: #ccc;
    font-size: 13px;
    text-align: center;
}

.subscription-status-label {
    color: var(--renegade-accent);
    font-weight: bold;
    font-size: 14px;
}

.subscription-status-usage {
    margin-top: 6px;
    color: #999;
    font-size: 12px;
}

.subscription-tier-list {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.subscription-tier-card {
    flex: 1 1 220px;
    min-width: 220px;
    background-color: #0d0d0d;
    border: 1px solid #333;
    border-radius: 10px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subscription-tier-card.current {
    border-color: var(--renegade-accent);
    box-shadow: 0 0 12px rgba(var(--renegade-accent-rgb), 0.25);
}

.subscription-tier-heading {
    color: var(--renegade-accent);
    font-size: 16px;
    font-weight: bold;
}

.subscription-tier-price {
    color: #eee;
    font-size: 20px;
    font-weight: bold;
}

.subscription-tier-features {
    color: #999;
    font-size: 12px;
}

.subscription-tier-current-badge {
    align-self: flex-start;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--renegade-accent);
    background-color: rgba(var(--renegade-accent-rgb), 0.12);
    border: 1px solid rgba(var(--renegade-accent-rgb), 0.4);
}

.subscription-tier-pay-btn {
    text-align: center;
    text-decoration: none;
    display: block;
    margin-top: 6px;
}

.subscription-tier-paypal-buttons {
    margin-top: 6px;
    min-height: 40px;
}

.subscription-tier-checkout-message {
    color: #7cfc7c;
    font-size: 11px;
    min-height: 14px;
    line-height: 1.4;
}

.subscription-tier-checkout-message.error {
    color: #ff6b6b;
}

.subscription-tier-note {
    color: #777;
    font-size: 10px;
    font-style: italic;
    line-height: 1.4;
}

.subscription-no-payments-hint {
    color: #999;
    font-size: 12px;
    font-style: italic;
}

.subscription-close-btn {
    align-self: flex-start;
    flex-shrink: 0;
    margin-top: 12px;
    width: auto;
    display: inline-block;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    cursor: pointer;
}

.reasoning-panel-embedded {
    display: block !important;
    position: static !important;
    top: auto !important;
    left: auto !important;
    transform: none !important;
    z-index: auto !important;
    width: 100% !important;
    
    max-width: 640px !important;
    max-height: none !important;
    margin: 0 auto !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
}

.reasoning-panel-embedded #reasoning-close-btn {
    display: none !important;
}

.coding-chat-content {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.coding-chat-layout {
    display: flex;
    gap: 16px;
    flex: 1 1 auto;
    min-height: 0;
}

.coding-chat-column {
    flex: 1 1 50%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.coding-chat-log {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid #333;
    border-radius: 8px;
    background: #050505;
    padding: 10px;
    margin-top: 8px;
}

.coding-chat-log .chat-message {
    margin-bottom: 12px;
}

.coding-chat-empty {
    color: #666;
    font-size: 12px;
    text-align: center;
    margin-top: 20px;
}

.coding-chat-error {
    color: #ff6b6b;
}

.coding-editor-column {
    border-left: 1px solid #333;
    padding-left: 16px;
}

.coding-editor-toolbar {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
}

.coding-editor-filename {
    width: 100%;
    min-width: 0;
    background: #111;
    color: #eee;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    font-family: 'Courier New', monospace;
    box-sizing: border-box;
}

.coding-editor-toolbar-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    justify-content: center;
}

#coding-editor-copy-btn,
#coding-editor-download-btn,
#coding-editor-clear-btn {
    border: none !important;
}

.coding-editor-textarea-large {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    margin-bottom: 0;
}

.coding-chat-insert-btn {
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 5px;
    cursor: pointer;
    font-size: 11px;
    padding: 3px 8px;
}

.coding-chat-insert-btn:hover {
    background-color: #222222;
}

.coding-editor-toolbar-status {
    color: var(--renegade-accent);
    font-size: 11px;
}

.image-generate-section {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.image-status {
    flex-shrink: 0;
    font-size: 12px;
    margin: 6px 0 10px;
    min-height: 14px;
    text-align: center;
}

.image-status.success {
    color: #39ff14;
}

.image-status.error {
    color: #ff6b6b;
}

.image-action-row {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}

.image-action-row .image-generate-btn,
.image-action-row .image-download-link,
.image-action-row .image-upload-label {
    width: 120px;
    height: 30px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 0;
    font-size: 12px;
    box-sizing: border-box;
}

.image-secondary-action-row {
    margin-top: -4px;
    justify-content: flex-start;
}

.image-secondary-action-row button {
    width: 120px;
    height: 28px;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    font-size: 11px;
    box-sizing: border-box;
}

.image-reference-preview-wrap {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    margin-bottom: 12px;
}

.image-reference-preview {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #444;
}

.image-reference-remove-btn {
    width: 110px;
    height: 26px;
    padding: 0;
    font-size: 11px;
}

.image-prompt-fields {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.image-prompt-input {
    min-height: 70px;
    margin-bottom: 8px;
}

.video-edit-ai-prompt-input {
    min-height: 100px;
}

.video-action-column,
.image-action-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.video-nav-workflows-btn,
.video-nav-settings-btn {
    text-align: left;
}

.admin-nav-close-btn {
    text-align: left;
    margin-top: auto;
    border-color: #555;
    color: #aaa;
}

.admin-nav-close-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.video-selected-workflow-label {
    flex-shrink: 0;
    font-size: 11px;
    color: #999;
    text-align: center;
    margin-bottom: 8px;
}

.video-reference-slots {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 12px;
    justify-content: center;
}

.video-nav-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.video-nav-stop-btn {
    border-color: #ff6b6b !important;
    color: #ff6b6b !important;
}

.video-nav-stop-btn:hover {
    background-color: rgba(255, 107, 107, 0.15) !important;
}

.video-nav-stop-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.video-reference-slot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    
    width: 168px;
}

.video-reference-slot .api-panel-label {
    font-size: 10px;
    text-align: center;
}

.video-reference-preview {
    width: 100%;
    
    height: 110px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #444;
}

.video-file-input-hidden {
    display: none;
}

.video-file-choose-label {
    display: inline-block;
    width: fit-content;
    margin: 0 auto;
    background-color: rgba(var(--renegade-accent-rgb), 0.15);
    border: 1px solid var(--renegade-accent);
    color: var(--renegade-accent);
    border-radius: 6px;
    padding: 6px 10px;
    font-size: 11px;
    cursor: pointer;
    text-align: center;
    white-space: nowrap;
}

.video-file-choose-label:hover {
    background-color: rgba(var(--renegade-accent-rgb), 0.28);
}

.video-generate-progress {
    flex-shrink: 0;
    font-size: 12px;
    color: var(--renegade-accent);
    text-align: center;
    margin-bottom: 8px;
}

.video-duration-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.video-duration-input {
    width: 60px;
}

.video-prompt-fields {
    flex: 0 0 50%;
    min-height: 0;
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
}

.video-prompt-fields .video-prompt-input {
    flex: 1 1 auto;
    min-height: 0;
    resize: none;
}

.video-result-square {
    width: 100%;
    aspect-ratio: 1 / 1;
    height: auto;
    object-fit: contain;
    background-color: #000;
}

.image-result-delete-btn {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 4px 8px;
    font-size: 11px;
}

.video-settings-panel {
    width: 480px;
    max-width: 90vw;
    max-height: 80vh;
    
    z-index: 10100;
    display: none;
    flex-direction: column;
}

.video-settings-panel.open {
    display: flex !important;
}

.video-settings-body {
    overflow-y: auto;
    padding-right: 4px;
}

.video-settings-select {
    width: 100%;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.video-settings-custom-resolution-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.video-settings-resolution-input {
    width: 90px;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    box-sizing: border-box;
}

.video-settings-duration-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 2px;
}

.video-settings-prompts-heading {
    margin-top: 16px;
    padding-bottom: 6px;
    border-bottom: 1px solid #333;
}

.video-settings-prompts-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.video-settings-prompt-field {
    display: flex;
    flex-direction: column;
}

.video-settings-prompt-input {
    min-height: 60px;
    resize: vertical;
}

.video-workflow-picker-panel {
    width: 360px;
    max-width: 90vw;
    z-index: 10000;
    display: none;
    flex-direction: column;
}

.video-workflow-picker-panel.open {
    display: flex !important;
}

.video-workflow-listbox {
    max-height: 40vh;
    overflow-y: auto;
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.video-workflow-item {
    width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 8px 6px;
    gap: 6px;
    border-bottom: 1px solid #333;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.video-workflow-item:last-child {
    border-bottom: none;
}

.video-workflow-item:hover,
.video-workflow-item:focus {
    background-color: #222;
    outline: none;
}

.video-workflow-item-left {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
}

.video-workflow-item-icon {
    margin-right: 6px;
    flex-shrink: 0;
}

.video-workflow-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-workflow-listbox-empty {
    padding: 14px 4px;
    font-size: 12px;
    color: #999;
    text-align: center;
}

.image-edit-panel {
    top: 20vh;
    bottom: 13vh;
    left: 14vw;
    right: 14vw;
    transform: none;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    overflow: hidden;
    z-index: 10000;
    display: none;
    flex-direction: column;
}

.image-edit-panel.open {
    display: flex !important;
}

.image-edit-panel.fullscreen {
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    z-index: 10050;
}

.image-edit-fullscreen-btn {
    position: absolute;
    top: 10px;
    right: 14px;
    width: 30px;
    height: 30px;
    background-color: #111;
    border: 1px solid #444;
    border-radius: 6px;
    color: #ccc;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
}

.image-edit-fullscreen-btn:hover {
    border-color: var(--renegade-accent);
    color: var(--renegade-accent);
}

.image-edit-panel .renegade-modal-title {
    flex-shrink: 0;
}

.image-edit-panel .renegade-modal-close-button {
    flex-shrink: 0;
    width: 140px;
    height: 30px;
    margin: 8px auto 0 auto;
    padding: 0;
}

.image-edit-menubar {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    padding: 6px 0;
    border-bottom: 1px solid #333;
    margin-bottom: 8px;
}

.video-edit-generation-status-bar {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    z-index: 20;
    background-color: #111;
    border: 1px solid var(--renegade-accent);
    border-radius: 20px;
    padding: 6px 16px;
    font-size: 11px;
    color: var(--renegade-accent);
    white-space: nowrap;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.image-edit-menu-btn {
    background-color: #111;
    border: 1px solid var(--renegade-accent);
    color: var(--renegade-accent);
    border-radius: 5px;
    padding: 5px 9px;
    height: 30px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    font-size: 11px;
    cursor: pointer;
    white-space: nowrap;
}

.image-edit-menu-btn:hover {
    background-color: rgba(var(--renegade-accent-rgb), 0.2);
}

.image-edit-menu-sep {
    width: 1px;
    align-self: stretch;
    background: #333;
    margin: 0 4px;
}

.video-edit-menu-dropdown-field {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    font-size: 11px;
    color: #ccc;
}

.video-edit-menu-dropdown-field select,
.video-edit-menu-dropdown-field input {
    flex: 0 0 auto;
    width: 110px;
}

.video-edit-menu-dropdown-sep {
    height: 1px;
    background-color: #333;
    margin: 4px 2px;
}

.video-edit-menu-dropdown-hint {
    font-size: 10px;
    color: #888;
    padding: 4px 8px;
    line-height: 1.4;
}

.video-edit-characters-row {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: flex-start;
    gap: 16px;
    flex-wrap: wrap;
}

.video-edit-character-column {
    flex: 0 0 auto;
    width: 220px;
    display: flex;
    flex-direction: column;
}

.video-edit-character-checkbox {
    justify-content: flex-start !important;
    gap: 6px !important;
}

.video-edit-character-checkbox input {
    width: auto !important;
    flex: 0 0 auto !important;
}

.video-edit-character-ref-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    padding: 6px 8px;
}

.video-edit-character-ref-grid-small {
    grid-template-columns: repeat(2, 1fr);
    max-width: 140px;
}

.video-edit-character-ref-slot {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background-color: #111;
    border: 1px dashed #444;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #666;
    cursor: pointer;
    overflow: hidden;
}

.video-edit-character-ref-slot:hover {
    border-color: var(--renegade-accent);
    color: var(--renegade-accent);
}

.video-edit-character-ref-slot img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-edit-character-ref-remove {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 16px;
    height: 16px;
    padding: 0;
    font-size: 9px;
    line-height: 1;
    background-color: rgba(0, 0, 0, 0.7);
    border: 1px solid #ff5c5c;
    color: #ff5c5c;
    border-radius: 3px;
    cursor: pointer;
}

.video-edit-audio-mixer-wrap {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.image-edit-menubar-spacer {
    flex: 1 1 auto;
}

.image-edit-menubar .account-panel-button {
    width: auto;
    flex: 0 0 auto;
    padding: 0 16px;
    height: 30px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: bold;
}

.image-edit-file-menu-wrap {
    position: relative;
}

.image-edit-file-dropdown {
    display: none;
    flex-direction: column;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    min-width: 140px;
    background-color: #111;
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    padding: 4px;
    gap: 2px;
    z-index: 10010;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

.image-edit-file-dropdown.open {
    display: flex;
}

.image-edit-file-dropdown-item {
    display: block !important;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    background: none;
    border: none;
    color: #ccc;
    padding: 6px 8px;
    font-size: 12px;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 !important;
}

.image-edit-file-dropdown-item:hover {
    background-color: rgba(var(--renegade-accent-rgb), 0.18);
    color: var(--renegade-accent);
}

.image-edit-file-dropdown-item-open {
    border: 1px solid var(--renegade-accent) !important;
}

.image-edit-body {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    gap: 10px;
}

.image-edit-toolbar {
    flex: 0 0 46px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
    padding-top: 4px;
}

.image-edit-tool-btn {
    width: 36px;
    height: 36px;
    background-color: #111;
    border: 1px solid #444;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-edit-tool-btn:hover {
    border-color: var(--renegade-accent);
}

.image-edit-tool-btn.active {
    background-color: rgba(var(--renegade-accent-rgb), 0.25);
    border-color: var(--renegade-accent);
}

.image-edit-canvas-area {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: repeating-conic-gradient(#1a1a1a 0% 25%, #111 0% 50%) 50% / 20px 20px;
    border: 1px solid #333;
    border-radius: 6px;
    overflow: auto;
}

.image-edit-canvas-zoom-wrap {
    position: relative;
    transform-origin: center center;
}

.image-edit-canvas {
    max-width: 100%;
    max-height: 100%;
    cursor: crosshair;
    touch-action: none;
}

.image-edit-selection-overlay {
    position: absolute;
    border: 1px dashed var(--renegade-accent);
    background: rgba(var(--renegade-accent-rgb), 0.1);
    pointer-events: none;
}

.image-edit-ai-panel {
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
    padding-left: 8px;
    border-left: 1px solid #333;
}

.image-edit-ai-prompt {
    min-height: 70px;
    resize: vertical;
}

.image-edit-ai-checkbox-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 6px;
    font-size: 11px;
}

.image-edit-ai-tools-heading {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid #333;
    font-size: 12px;
}

.image-edit-tool-popup {
    width: 380px;
    max-width: 90vw;
    max-height: 70vh;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    
    z-index: 10100;
}

.image-edit-tool-popup.open {
    display: flex !important;
}

.video-edit-management-popup {
    width: 520px;
}

.video-edit-help-content {
    font-size: 12px;
    line-height: 1.6;
    color: #ccc;
}

.video-edit-help-content h1,
.video-edit-help-content h2,
.video-edit-help-content h3 {
    color: var(--renegade-accent);
    margin: 14px 0 6px 0;
}

.video-edit-help-content h1:first-child,
.video-edit-help-content h2:first-child {
    margin-top: 0;
}

.video-edit-help-content ul {
    margin: 4px 0 10px 0;
    padding-left: 18px;
}

.video-edit-help-content li {
    margin-bottom: 4px;
}

.video-edit-help-content code {
    background-color: #111;
    padding: 1px 4px;
    border-radius: 3px;
}

.image-edit-properties-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px;
    border-left: 1px solid #333;
    border-right: 1px solid #333;
    margin: 0 4px;
}

.image-edit-properties-tool-label {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
}

.image-edit-properties-inline-field {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    white-space: nowrap;
    margin: 0;
}

.image-edit-ai-tool-btn {
    width: 100%;
    font-size: 11px;
    padding: 6px 8px;
    text-align: left;
}

.image-edit-layer-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.image-edit-layer-row {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #111;
    border: 1px solid #333;
    border-radius: 5px;
    padding: 4px 6px;
    cursor: pointer;
}

.image-edit-layer-row.active {
    border-color: var(--renegade-accent);
    background: rgba(var(--renegade-accent-rgb), 0.1);
}

.image-edit-layer-icon-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 12px;
    background: none;
    border: 1px solid #444;
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
}

.image-edit-layer-name {
    flex: 1 1 auto;
    font-size: 11px;
    color: #ccc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.image-edit-layer-opacity {
    width: 60px;
    flex-shrink: 0;
}

.image-edit-layer-blend {
    width: 90px;
    flex-shrink: 0;
    font-size: 10px;
    padding: 3px 4px;
}

.image-edit-layer-actions {
    display: flex;
    gap: 3px;
    flex-shrink: 0;
}

.image-edit-properties {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.image-edit-properties-tool-label {
    color: var(--renegade-accent);
    font-size: 12px;
    font-weight: bold;
}

.video-edit-panel {
    
    top: 20vh;
    bottom: 13vh;
    left: 14vw;
    right: 14vw;
    transform: none;
    width: auto;
    height: auto;
    max-width: none;
    max-height: none;
    overflow: hidden;
    z-index: 10000;
    display: none;
    flex-direction: column;
}

.video-edit-panel.open {
    display: flex !important;
}

.video-edit-panel.fullscreen {
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    border-radius: 0;
    z-index: 10050;
}

.video-edit-panel .renegade-modal-title {
    flex-shrink: 0;
}

.video-edit-panel .renegade-modal-close-button {
    flex-shrink: 0;
    width: 140px;
    height: 30px;
    margin: 10px 0 0 0;
    padding: 0;
}

.video-edit-section {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.video-edit-toolbar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.video-edit-toolbar-hint {
    margin: 0;
}

.video-edit-output-resolution-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    margin-left: auto;
}

.video-edit-output-resolution-select {
    width: auto;
    margin-bottom: 0;
}

.video-edit-clip-audio-row {
    margin-top: 4px;
}

.video-edit-mute-label {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 4px;
    font-size: 10px;
}

.video-edit-timeline {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.video-edit-timeline-empty {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 13px;
    border: 1px dashed #444;
    border-radius: 8px;
}

.video-edit-section-v2 {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.video-edit-body-row {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    gap: 10px;
}

.video-edit-center-column {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.video-edit-preview-wrap {
    flex: 1 1 auto;
    min-height: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    border: 1px solid #333;
    border-radius: 6px;
    overflow: hidden;
}

.video-edit-preview-player {
    max-width: 100%;
    max-height: 100%;
    display: none;
}

.video-edit-preview-placeholder {
    color: #666;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.video-edit-multitrack {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.video-edit-track-row {
    display: flex;
    align-items: stretch;
    gap: 6px;
}

.video-edit-track-label {
    flex: 0 0 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: #888;
    background-color: #161616;
    border: 1px solid #333;
    border-radius: 4px;
}

.video-edit-track-lane {
    flex: 1 1 auto;
    min-width: 0;
    height: 18px;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    overflow-y: hidden;
    background-color: #0d0d0d;
    border: 1px solid #333;
    border-radius: 4px;
    padding: 2px;
}

.video-edit-track-lane-absolute {
    position: relative;
    display: block;
}

.video-edit-track-segment {
    flex: 1 0 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    color: #666;
    background-color: #161616;
    border-radius: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 0 4px;
    cursor: pointer;
}

.video-edit-track-segment.has-content {
    color: var(--renegade-accent);
    background-color: rgba(var(--renegade-accent-rgb), 0.15);
    border: 1px solid rgba(var(--renegade-accent-rgb), 0.4);
}

.video-edit-text-track-block {
    position: absolute;
    top: 2px;
    bottom: 2px;
    font-size: 9px;
    padding: 0 4px;
    display: flex;
    align-items: center;
}

.video-edit-track-row > .video-edit-timeline-v2 {
    flex: 1 1 auto;
    height: 54px;
}

.video-edit-transport-bar {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 8px;
    background-color: #111;
    border: none;
    border-radius: 6px;
}

.video-edit-transport-btn {
    background-color: transparent;
    border: none;
    border-radius: 5px;
    color: #ccc;
    width: 30px;
    height: 28px;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.video-edit-transport-btn:hover {
    background-color: #161616;
    color: var(--renegade-accent);
}

.video-edit-transport-time {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

.video-edit-transport-icon-label {
    font-size: 13px;
    margin-left: 6px;
}

.video-edit-transport-slider {
    width: 80px;
}

.video-edit-timeline-v2 {
    flex-direction: row !important;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 8px;
    padding-bottom: 4px;
}

.video-edit-timeline-block {
    flex: 1 0 120px;
    min-width: 120px;
    max-width: 260px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    background: #111;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 4px 8px;
    cursor: pointer;
    position: relative;
}

.video-edit-timeline-block:hover {
    border-color: var(--renegade-accent);
}

.video-edit-timeline-block.active {
    border-color: var(--renegade-accent);
    background: rgba(var(--renegade-accent-rgb), 0.12);
}

.video-edit-timeline-block .video-edit-clip-name {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 11px;
    color: #ccc;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-edit-transition-badge {
    flex-shrink: 0;
    font-size: 9px;
    color: var(--renegade-accent);
}

.video-edit-timeline-block .video-edit-clip-actions {
    flex-shrink: 0;
    display: flex;
    gap: 3px;
    margin-left: auto;
}

.video-edit-timeline-block .project-file-action-btn {
    width: 18px;
    height: 18px;
    padding: 0;
    font-size: 9px;
}

.video-edit-right-panel {
    flex: 0 0 220px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding-left: 8px;
    border-left: 1px solid #333;
}

.video-edit-right-tabs {
    flex-shrink: 0;
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.video-edit-right-tabs .admin-nav-tab {
    flex: 1 1 auto;
    text-align: center;
    padding: 6px 4px;
    font-size: 11px;
}

.video-edit-properties-panel,
.video-edit-ai-panel {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-y: auto;
}

.video-edit-ai-panel .image-edit-ai-tool-btn {
    width: 100%;
    text-align: left;
    font-size: 11px;
    padding: 6px 8px;
}

.video-edit-clip-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    border: 1px solid #333;
    border-radius: 8px;
    padding: 10px;
}

.video-edit-clip-preview {
    width: 160px;
    height: 90px;
    flex-shrink: 0;
    background: #000;
    border-radius: 6px;
    object-fit: cover;
}

.video-edit-clip-info {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.video-edit-clip-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.video-edit-clip-index {
    flex-shrink: 0;
    color: var(--renegade-accent);
    font-weight: bold;
    font-size: 12px;
}

.video-edit-clip-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    color: #ccc;
}

.video-edit-trim-row {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.video-edit-trim-row .api-panel-label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 10px;
}

.video-edit-trim-input {
    width: 70px;
}

.video-edit-duration {
    flex-shrink: 0;
    font-size: 11px;
    color: #999;
}

.video-edit-transition-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-edit-transition-row .api-panel-label {
    font-size: 11px;
    margin: 0;
}

.video-edit-transition-select {
    font-size: 12px;
}

.video-edit-clip-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.video-edit-audio-row {
    flex-shrink: 0;
    border-top: 1px solid #333;
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.video-edit-audio-label {
    font-size: 12px;
    color: #999;
}

.video-edit-audio-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

.video-edit-audio-name {
    font-size: 12px;
    color: #ccc;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.video-edit-audio-controls .api-panel-label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 10px;
}

.video-edit-text-row {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 8px;
    border: 1px solid #333;
    border-radius: 6px;
}

.video-edit-text-overlay-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.video-edit-text-overlay-item {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.video-edit-text-overlay-input {
    flex: 1 1 120px;
    min-width: 100px;
    background-color: #111;
    border: 1px solid #444;
    border-radius: 4px;
    color: #eee;
    padding: 5px 8px;
    font-size: 12px;
}

.video-edit-export-row {
    flex-shrink: 0;
    border-top: 1px solid #333;
    padding-top: 8px;
}

.video-edit-export-status {
    margin-bottom: 4px;
}

.video-edit-result-area {
    flex-shrink: 0;
    margin-bottom: 20px;
}

.image-result-area {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    margin-bottom: 10px;
    overflow: hidden;
}

.image-result-figure {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.image-result-img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--renegade-accent);
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

.image-download-link {
    display: inline-block;
    width: auto;
    text-decoration: none;
    padding: 6px 14px;
}

.image-action-column .image-download-link,
.image-action-column .image-upload-label,
.video-action-column .image-download-link {
    display: block;
    width: 100%;
    box-sizing: border-box;
    margin: 0;
    text-align: left;
    padding: 8px 10px;
    background-color: transparent;
    border: 1px solid #444;
    border-radius: 6px;
    color: #ccc;
    font-size: 12px;
    white-space: normal;
}

.image-action-column .image-download-link:hover,
.image-action-column .image-upload-label:hover,
.video-action-column .image-download-link:hover {
    background-color: transparent;
    border-color: var(--renegade-accent);
    color: var(--renegade-accent);
}

.image-nav-delete-btn {
    color: #ff6b6b;
    border-color: #ff6b6b;
}

.image-nav-delete-btn:hover {
    background-color: rgba(255, 107, 107, 0.12);
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.video-edit-close-tool-btn {
    color: #ff6b6b;
    border-color: #ff6b6b;
}

.video-edit-close-tool-btn:hover {
    background-color: rgba(255, 107, 107, 0.12);
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.image-recent-panel {
    width: 90vw;
    max-width: 480px;
    max-height: 70vh;
    display: none;
    flex-direction: column;
}

.image-recent-panel.open {
    display: flex !important;
}

.image-recent-grid {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 10px;
    padding: 4px;
    margin-bottom: 12px;
}

.image-recent-thumb-wrap {
    position: relative;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    background-color: #111;
}

.image-recent-thumb-wrap:hover {
    border-color: rgba(var(--renegade-accent-rgb), 0.5);
}

.image-recent-thumb-wrap.active {
    border-color: var(--renegade-accent);
}

.image-recent-thumb {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
}

.image-recent-empty {
    grid-column: 1 / -1;
    color: #999;
    font-size: 12px;
    text-align: center;
    padding: 20px;
}

.chat-inline-image {
    display: block;
    max-width: min(420px, 100%);
    border-radius: 8px;
    border: 1px solid var(--renegade-accent);
    margin: 6px 0;
}

.theme-panel {
    width: 300px;
}

.theme-swatch-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 14px;
}

.theme-swatch {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: #111;
    color: #ccc;
    border: 1px solid #444;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
}

.theme-swatch:hover {
    border-color: var(--renegade-accent);
}

.theme-swatch.selected {
    border-color: var(--renegade-accent);
    background: rgba(var(--renegade-accent-rgb), 0.1);
    color: var(--renegade-accent);
}

.theme-swatch-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.5);
}

.theme-panel-content {
    display: flex;
    flex-direction: column;
}

.theme-back-button {
    align-self: flex-start;
    background: none;
    border: none;
    color: var(--renegade-accent);
    cursor: pointer;
    font-size: 12px;
    padding: 0 0 10px 0;
    text-align: left;
}

.theme-back-button:hover {
    text-decoration: underline;
}

.theme-group-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 14px;
}

.theme-group-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 82px;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.theme-group-card-thumb {
    display: block;
    width: 82px;
    height: 64px;
    box-sizing: border-box;
    border-radius: 6px;
    background-size: cover;
    background-position: center;
    border: 1px solid var(--renegade-accent);
}

.theme-group-card.selected .theme-group-card-thumb {
    box-shadow: 0 0 6px rgba(var(--renegade-accent-rgb), 0.8);
}

.theme-group-card-label {
    margin-top: 6px;
    font-size: 11px;
    color: #ccc;
    text-align: center;
}

.theme-group-card.selected .theme-group-card-label {
    color: var(--renegade-accent);
}


.theme-group-card-nature .theme-group-card-thumb {
    border-style: solid;
    border-width: 3px;
    border-color: rgb(122, 154, 90);
    border-image-source: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Crect width='24' height='24' fill='rgb(91,58,41)'/%3E%3Cellipse cx='6' cy='7' rx='6' ry='3' fill='rgb(107,142,35)' transform='rotate(-30 6 7)'/%3E%3Cellipse cx='18' cy='17' rx='6' ry='3' fill='rgb(63,107,47)' transform='rotate(30 18 17)'/%3E%3C/svg%3E");
    border-image-slice: 6;
    border-image-repeat: round;
}

.theme-group-card-love .theme-group-card-thumb {
    border-style: solid;
    border-width: 3px;
    border-color: rgb(200, 16, 46);
    border-image-source: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24'%3E%3Crect width='24' height='24' fill='rgb(90,10,20)'/%3E%3Cpath d='M12 15 C8 11 4 12 5 8 C6 5 10 6 12 9 C14 6 18 5 19 8 C20 12 16 11 12 15 Z' fill='rgb(255,63,164)'/%3E%3C/svg%3E");
    border-image-slice: 6;
    border-image-repeat: round;
}

.data-panel {
    width: 360px;
}

.data-panel-hint {
    color: #999;
    font-size: 11px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.data-panel-textarea {
    width: 100%;
    height: 160px;
    background: #000;
    color: var(--renegade-accent);
    border: 1px solid #444;
    border-radius: 6px;
    padding: 8px;
    box-sizing: border-box;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    resize: vertical;
    margin-bottom: 8px;
}

.data-panel-status {
    font-size: 11px;
    margin-bottom: 10px;
    min-height: 14px;
}

.data-panel-status.success {
    color: #39ff14;
}

.data-panel-status.error {
    color: #ff6b6b;
}

.data-panel-button-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.data-panel-export-btn,
.data-panel-import-btn {
    flex: 1;
    padding: 8px;
    background: #111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    box-sizing: border-box;
}

.data-panel-export-btn:hover,
.data-panel-import-btn:hover {
    background: var(--renegade-accent);
    color: #000;
}

.data-panel-storage-section {
    border-top: 1px solid #333;
    padding-top: 12px;
    margin-top: 4px;
}

.data-panel-storage-heading {
    color: var(--renegade-accent);
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 6px;
}

.data-panel-clear-history-btn {
    width: 100%;
    padding: 8px;
    background: #1a0000;
    color: #ff6b6b;
    border: 1px solid #ff6b6b;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    box-sizing: border-box;
}

.data-panel-clear-history-btn:hover {
    background: #ff6b6b;
    color: #000;
}

.api-panel {
    width: 380px;
}

.api-panel-hint {
    color: #999;
    font-size: 11px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.api-panel-label {
    display: block;
    color: var(--renegade-accent);
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 4px;
}

.api-panel-input {
    margin-bottom: 12px;
}

.api-panel-status {
    font-size: 11px;
    margin-bottom: 10px;
    min-height: 14px;
}

.api-panel-status.success {
    color: #39ff14;
}

.api-panel-status.error {
    color: #ff6b6b;
}

.api-panel-button-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.api-panel-button-row .account-panel-button {
    flex: 1;
    font-size: 11px;
}

#login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-input {
    width: 100%;
    padding: 10px;
    background-color: #111111;
    color: #eee;
    border: 2px solid var(--renegade-accent);
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.login-input:focus {
    outline: none;
    border-color: #ffea9e;
}

.login-input:disabled {
    opacity: 0.6;
}

.login-password-row {
    position: relative;
    display: flex;
}

.login-password-row .login-password-input {
    padding-right: 56px;
}

.login-password-toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--renegade-accent);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.login-password-toggle:hover {
    background-color: rgba(var(--renegade-accent-rgb), 0.12);
}

.login-remember-row {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 12px;
    color: #ccc;
    margin-top: 2px;
}

.login-remember-row input[type="checkbox"] {
    accent-color: var(--renegade-accent);
    width: 14px;
    height: 14px;
    cursor: pointer;
    flex-shrink: 0;
}

.login-form-error {
    color: #ff6b6b;
    font-size: 12px;
    text-align: center;
}

.login-form-info {
    color: var(--renegade-accent);
    font-size: 12px;
    text-align: center;
}

.login-submit-button {
    width: 100%;
    padding: 12px;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 2px solid var(--renegade-accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 15px;
    font-weight: bold;
    box-sizing: border-box;
}

.login-submit-button:hover:not(:disabled) {
    background-color: #222222;
}

.login-submit-button:disabled {
    opacity: 0.6;
    cursor: default;
}

.login-toggle-button {
    width: 100%;
    background: none;
    border: none;
    color: var(--renegade-accent);
    text-decoration: underline;
    font-size: 12px;
    cursor: pointer;
    margin-top: 10px;
    padding: 4px;
}

.login-forgot-button {
    width: auto;
    display: block;
    margin: 2px 0 0 auto;
    background: none;
    border: none;
    color: var(--renegade-accent);
    text-decoration: underline;
    font-size: 12px;
    cursor: pointer;
    padding: 4px;
}

.login-oauth-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 12px 0 8px 0;
}

.login-oauth-divider::before,
.login-oauth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: #333;
}

.login-oauth-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    box-sizing: border-box;
    margin-bottom: 8px;
    border: 1px solid #444;
}

.login-oauth-button span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

.login-google-button {
    background-color: #ffffff;
    color: #3c4043;
}

.login-google-button span {
    background-color: #ffffff;
    color: #4285f4;
    border: 1px solid #dadce0;
}

.login-google-button:hover {
    background-color: #f7f7f7;
}

.login-facebook-button {
    background-color: #1877f2;
    color: #ffffff;
    border-color: #1877f2;
}

.login-facebook-button span {
    background-color: #ffffff;
    color: #1877f2;
}

.login-facebook-button:hover {
    background-color: #166fe0;
}

.renegade-modal-close-button {
    width: 100%;
    padding: 8px;
    margin-top: 8px;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    box-sizing: border-box;
}

.renegade-modal-close-button:hover {
    background-color: #222222;
}

.account-panel-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.account-panel-button {
    width: 100%;
    padding: 10px 12px;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    text-align: center;
    box-sizing: border-box;
}

.account-panel-button:hover {
    background-color: #222222;
}

.avatar-panel-preview {
    display: block;
    width: 120px;
    height: 120px;
    max-width: 120px;
    max-height: 120px;
    object-fit: cover;
    border-radius: 50%;
    border: 2px solid var(--renegade-accent);
    margin: 0 auto 12px auto;
    background-color: #111111;
}

.avatar-panel-hint {
    color: #999;
    font-size: 11px;
    text-align: center;
    margin-bottom: 10px;
}

.avatar-panel-status {
    color: var(--renegade-accent);
    font-size: 12px;
    text-align: center;
    min-height: 16px;
    margin-bottom: 8px;
}

.project-panel {
    width: 460px;
    max-width: 92vw;
}

.project-panel-hint {
    color: #999;
    font-size: 11px;
    text-align: center;
    margin-bottom: 10px;
}

.project-panel-usage {
    color: #777;
    font-size: 10px;
    text-align: center;
    margin-bottom: 10px;
}

.project-panel-usage-warning {
    color: #ff6b6b;
    font-weight: bold;
}

.project-panel-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.project-panel-toolbar .account-panel-button {
    flex: 1;
}

.project-panel-empty {
    color: #999;
    font-size: 13px;
    text-align: center;
    padding: 16px 0;
}

.project-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 10px;
}

.project-file-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 8px 10px;
    background-color: #111111;
}

.project-file-meta {
    min-width: 0;
    flex: 1;
}

.project-file-name {
    color: var(--renegade-accent);
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-file-detail {
    color: #999;
    font-size: 11px;
    margin-top: 2px;
}

.project-file-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.project-file-action-btn {
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 5px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 13px;
}

.project-file-action-btn:hover {
    background-color: #222222;
}

.project-file-delete-btn {
    color: #ff6b6b;
    border-color: #663333;
}

.project-file-delete-btn:hover {
    background-color: #221111;
    border-color: #ff6b6b;
}

.project-editor-panel {
    width: 640px;
    max-width: 92vw;
}

.project-editor-textarea {
    width: 100%;
    height: 40vh;
    box-sizing: border-box;
    background-color: #0a0a0a;
    color: var(--renegade-code-color);
    border: 1px solid #444;
    border-radius: 6px;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    resize: vertical;
    margin-bottom: 8px;
}

.project-editor-status {
    color: var(--renegade-accent);
    font-size: 12px;
    min-height: 16px;
    margin-bottom: 8px;
    text-align: center;
}

.project-editor-button-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.project-editor-button-row .account-panel-button {
    flex: 1;
}

.project-editor-divider {
    color: var(--renegade-accent);
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 10px;
    margin-bottom: 8px;
}

.project-editor-instruction {
    width: 100%;
    box-sizing: border-box;
    background-color: #111111;
    color: #eee;
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    padding: 8px 10px;
    font-size: 13px;
    min-height: 60px;
    resize: vertical;
    margin-bottom: 8px;
}

.file-history-panel {
    width: 640px;
    max-width: 92vw;
}

.file-history-body {
    display: flex;
    gap: 10px;
    max-height: 55vh;
}

.file-history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 180px;
    flex-shrink: 0;
    overflow-y: auto;
}

.file-history-entry {
    text-align: left;
    background-color: #111111;
    color: #ccc;
    border: 1px solid #444;
    border-radius: 5px;
    padding: 6px 8px;
    cursor: pointer;
    font-size: 12px;
}

.file-history-entry:hover {
    background-color: #1a1a1a;
    border-color: var(--renegade-accent);
}

.file-history-entry.selected {
    border-color: var(--renegade-accent);
    background-color: #1a1a1a;
    color: var(--renegade-accent);
}

.file-history-entry-note {
    font-weight: bold;
    margin-bottom: 2px;
    white-space: normal;
    word-break: break-word;
}

.file-history-entry-time {
    font-size: 10px;
    color: #888;
}

.file-history-diff-area {
    flex: 1;
    overflow: auto;
    min-width: 0;
}

.scan-history-panel {
    width: 460px;
    max-width: 92vw;
}

.scan-history-empty {
    color: #999;
    font-size: 13px;
    text-align: center;
    padding: 10px 0;
}

.scan-history-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 50vh;
    overflow-y: auto;
    margin-bottom: 10px;
}

.scan-history-entry {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 8px 10px;
    background-color: #111111;
}

.scan-history-entry-meta {
    min-width: 0;
    flex: 1;
}

.scan-history-entry-time {
    color: var(--renegade-accent);
    font-size: 12px;
    font-weight: bold;
}

.scan-history-entry-files {
    color: #999;
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 2px 0;
}

.scan-history-entry-counts {
    color: #ccc;
    font-size: 11px;
}

.scan-history-view-btn {
    flex-shrink: 0;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 5px;
    padding: 6px 10px;
    font-size: 11px;
    cursor: pointer;
}

.scan-history-view-btn:hover {
    background-color: #222222;
}

.scan-history-clear-btn {
    width: 100%;
    margin-top: 4px;
    background-color: #111111;
    color: #ff6b6b;
    border: 1px solid #663333;
    border-radius: 5px;
    padding: 7px;
    font-size: 12px;
    cursor: pointer;
}

.scan-history-clear-btn:hover {
    background-color: #221111;
    border-color: #ff6b6b;
}

.find-bug-diff {
    border: 1px solid #333;
    border-radius: 6px;
    overflow: hidden;
    margin-top: 4px;
}

.find-bug-diff-pre {
    margin: 0;
    padding: 6px 0;
    background: #020202;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre;
    overflow-x: auto;
    tab-size: 4;
}

.find-bug-diff-line {
    padding: 0 10px;
    white-space: pre;
}

.find-bug-diff-context {
    color: #888;
}

.find-bug-diff-remove {
    color: #ff8080;
    background: rgba(255, 0, 0, 0.08);
}

.find-bug-diff-add {
    color: var(--renegade-code-color);
    background: rgba(57, 255, 20, 0.08);
}

.find-bug-diff-char-remove {
    background: rgba(255, 0, 0, 0.45);
    color: #fff;
    border-radius: 2px;
}

.find-bug-diff-char-add {
    background: rgba(57, 255, 20, 0.45);
    color: #000;
    border-radius: 2px;
}

.find-bug-post-apply-panel {
    display: none;
    gap: 10px;
}

.find-bug-post-apply-panel.is-visible {
    display: flex;
}

@keyframes repairCodePulse {
    0%,
    100% {
        border-color: var(--renegade-accent);
        box-shadow:
            0 0 3px rgba(255, 0, 0, 0.2),
            0 0 6px rgba(255, 0, 0, 0.1);
    }

    50% {
        border-color: #ff0000;
        box-shadow:
            0 0 10px rgba(255, 0, 0, 0.85),
            0 0 22px rgba(255, 0, 0, 0.55),
            0 0 35px rgba(255, 0, 0, 0.3);
    }
}

.file-panel-title {
    
    position: relative;
    text-align: center;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    
    border-bottom: 2px solid var(--renegade-accent);
    padding-bottom: 4px;
    padding-top: 6px;
    margin-bottom: 6px;
    width: 120% !important;
}

.file-panel-title::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 0;
    box-shadow: 0 0 15px var(--renegade-accent);
}

#files-section {
    margin-top: 15vh;
    width: 120% !important;
}

#files-section > .file-panel-title {
    width: 100% !important;
}

#files-section .file-drop-zone,
#files-section .file-list {
    width: 100% !important;
}

#files-section .file-item {
    width: 100% !important;
}

#history-list {
    width: 120% !important;
}

.right-nav > .file-panel-title:first-child {
    width: 120% !important;
}

.history-listbox {
    width: 120% !important;
    overflow-y: visible;
    max-height: none;
    margin-top: 8px;
    background: transparent !important;
    border: none !important;
    padding: 8px;
    box-sizing: border-box;
}

.history-item {
    width: 100% !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 6px;
    gap: 6px;
    background: transparent !important;
    border-bottom: 1px solid #333;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.history-item:hover {
    background-color: #222;
    cursor: pointer;
}

.history-item-left {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
}

.history-item-icon {
    margin-right: 6px;
    flex-shrink: 0;
}

.history-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.history-item-actions {
    background: transparent !important;
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.history-item-text {
    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--renegade-accent);
    font-size: 0.8rem;
    font-weight: bold;
}

.history-item-summary {
    display: block;
    min-width: 0;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #9b9b9b;
    font-family: Arial, sans-serif;
    font-size: 0.68rem;
}

.history-empty {
    padding: 10px;
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.7;
}

.file-item-btn {
    width: auto;
    background: none;
    border: 1px solid var(--renegade-accent);
    color: var(--renegade-accent);
    padding: 2px 6px;
    font-size: 0.7rem;
    line-height: 1;
    border-radius: 6px;
    cursor: pointer;
    flex-shrink: 0;
}

.file-item-btn:hover {
    background: var(--renegade-accent);
    color: #000;
}

.right-nav {
    position: fixed;
    top: 20vh;
    right: 4%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    width: 9%;
    z-index: 20;
}

.right-nav > button {
    width: 110px;
    box-sizing: border-box;
}

.unread-messages-badge {
    display: none;
    position: fixed;
    z-index: 20001;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    box-sizing: border-box;
    padding: 0;
    background-color: #111111;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.unread-messages-icon {
    font-size: 18px;
    line-height: 1;
    pointer-events: none;
}

.unread-messages-count {
    display: none;
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    align-items: center;
    justify-content: center;
    background-color: #ffd400;
    color: #000;
    border-radius: 999px;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    pointer-events: none;
}

.unread-messages-badge-pulse {
    animation: unreadMessagesBadgePulse 1.4s ease-in-out infinite;
}

@keyframes unreadMessagesBadgePulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(57, 255, 20, 0.65);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(57, 255, 20, 0);
    }
}

.unread-messages-dropdown {
    position: fixed;
    display: flex;
    flex-direction: column;
    width: 220px;
    max-width: calc(100vw - 16px);
    max-height: 320px;
    overflow-y: auto;
    padding: 4px;
    background-color: #111111;
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
    z-index: 20000;
}

.unread-messages-dropdown-empty {
    padding: 10px;
    font-size: 12px;
    color: #888;
    text-align: center;
}

.unread-messages-dropdown-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
    background: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-align: left;
}

.unread-messages-dropdown-row:hover {
    background-color: #1c1c1c;
}

.unread-messages-dropdown-name {
    flex: 1;
    min-width: 0;
    color: #fff;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.unread-messages-dropdown-count {
    flex-shrink: 0;
    min-width: 18px;
    padding: 1px 6px;
    background-color: var(--renegade-accent);
    color: #000;
    border-radius: 999px;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
}


.reaction-bell-btn {
    display: none;
    position: fixed;
    top: 15px;
    right: 15px;
    z-index: 20001;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    box-sizing: border-box;
    padding: 0;
    background-color: #111111;
    border: none;
    border-radius: 50%;
    cursor: pointer;
}

.reaction-bell-icon {
    font-size: 18px;
    line-height: 1;
    pointer-events: none;
}

.reaction-bell-count {
    display: none;
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    align-items: center;
    justify-content: center;
    background-color: #ffd400;
    color: #000;
    border-radius: 999px;
    font-size: 10px;
    font-weight: bold;
    text-align: center;
    pointer-events: none;
}

.reaction-bell-btn-pulse {
    animation: reactionBellPulse 1.4s ease-in-out infinite;
}

/* Green, matching the unread-messages icon's pulse. */
@keyframes reactionBellPulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(57, 255, 20, 0.65);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(57, 255, 20, 0);
    }
}

/* Windows app only (html.renegade-windows-app is set in index.html's <head> when the
   page runs inside the app's WebView2): the window's own frame crowds the corners, so
   the messages icon (top-left) and bell (top-right) sit 50px further down and in.
   !important because friends.js positions the messages icon with inline styles. */
html.renegade-windows-app #unread-messages-badge {
    top: 65px !important;
    left: 75px !important;
}

/* Windows (any browser, and the Windows app): left nav buttons 50% closer together
   (15px -> 7.5px). html.renegade-windows is set in index.html's <head>. Phone-width
   layouts keep their own spacing from mobile.css. */
html.renegade-windows .left-nav {
    gap: 7.5px;
}

html.renegade-windows-app #reaction-bell-btn {
    top: 65px !important;
    right: 75px !important;
}

/* Computer browsers (not the Windows app, not phone-width screens): the messages icon
   (top-left) and bell (top-right) sit 30px further down and in than the 15px default. */
@media (min-width: 500px) and (hover: hover) and (pointer: fine) {
    html:not(.renegade-windows-app) #unread-messages-badge {
        top: 45px !important;
        left: 55px !important;
    }

    html:not(.renegade-windows-app) #reaction-bell-btn {
        top: 45px !important;
        right: 55px !important;
    }
}


.reaction-bell-panel {
    display: none;
    position: fixed;
    
    z-index: 20002;
    background-color: #000000;
    border: 1px solid var(--renegade-accent);
    border-radius: 10px;
    padding: 18px;
    width: 260px;
    max-width: calc(100vw - 30px);
    max-height: calc(100vh - 30px);
    box-sizing: border-box;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.8);
    overflow: hidden;
    flex-direction: column;
}

.reaction-bell-panel.open {
    display: flex !important;
}

#reaction-bell-panel-list {
    margin-top: 8px;
    overflow-y: auto;
}

.right-nav #upload-btn {
    width: 110px !important;
    height: 30px !important;
    flex-shrink: 0;

    
    position: absolute;
    top: calc(50vh - 200px);
    left: 50%;
    transform: translateX(-50%);
}

.right-nav #upload-btn ~ .file-panel-title {
    
    position: absolute;
    top: calc(50vh - 155px);
    left: 0;
    margin-top: 0;
    margin-bottom: 0;
}

.right-nav #upload-btn ~ .file-drop-zone {
    position: absolute;
    top: calc(50vh - 110px);
    left: 0;
    margin-top: 0;
}

.right-nav #upload-btn ~ .file-list {
    position: absolute;
    top: calc(50vh - 50px);
    left: 0;
    margin-top: 0;
}

.right-nav .file-panel-title,
.right-nav .file-drop-zone,
.right-nav .file-list {
    width: 100%;
}

.file-drop-zone {
    border: 1px dashed var(--renegade-accent);
    border-radius: 8px;
    padding: 10px;
    font-size: 0.8rem;
    text-align: center;
    color: var(--renegade-accent);
    transition: 0.25s ease;
}

.file-drop-zone.drag-over {
    background-color: rgba(var(--renegade-accent-rgb), 0.1);
    box-shadow: 0 0 10px var(--renegade-accent);
}

.file-list {
    max-height: 400px;
    overflow-y: visible;
    margin-top: 8px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 6px;
    border-bottom: 1px solid #333;
    font-size: 0.8rem;
    gap: 6px;
}

.file-item-left {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
}

.file-item-icon {
    margin-right: 6px;
    flex-shrink: 0;
}

.file-item-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.file-item-checkbox {
    margin-right: 8px;
    flex-shrink: 0;
    accent-color: var(--renegade-accent);
    cursor: pointer;
}

.file-select-all-row {
    display: flex;
    align-items: center;
    padding: 5px 6px;
    border-bottom: 1px solid var(--renegade-accent);
    font-size: 0.75rem;
    color: var(--renegade-accent);
    opacity: 0.9;
}

.file-select-all-label {
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-severity-filter-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 5px 6px;
    border-bottom: 1px solid #333;
    font-size: 0.72rem;
    color: #999;
}

.file-severity-filter-select {
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 4px;
    font-size: 0.72rem;
    padding: 2px 4px;
    cursor: pointer;
}

.file-severity-badge {
    margin-left: 4px;
    flex-shrink: 0;
    font-size: 0.85em;
}

.history-search-input {
    width: 100%;
    box-sizing: border-box;
    margin: 4px 0 8px;
    padding: 6px 8px;
    background-color: #111111;
    color: #eee;
    border: 1px solid var(--renegade-accent);
    border-radius: 5px;
    font-size: 0.78rem;
}

.history-search-input:focus {
    outline: none;
    border-color: #ffea9e;
}

.history-search-input::placeholder {
    color: #777;
}

.history-io-row {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.history-io-btn {
    flex: 1;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 5px;
    padding: 5px 4px;
    font-size: 0.72rem;
    cursor: pointer;
}

.history-io-btn:hover {
    background-color: #222222;
}

.conversations-panel {
    width: 320px;
    max-width: 92vw;
}

.conversations-panel .history-search-input {
    margin-top: 0;
}

.conversations-panel-hint {
    color: #888;
    font-size: 0.7rem;
    line-height: 1.4;
    margin: 10px 0;
    text-align: center;
}

.undo-toast {
    position: fixed;
    left: 50%;
    top: 25%;
    transform: translate(-50%, 20px);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 14px;
    background-color: #000000;
    border: 2px solid var(--renegade-accent);
    border-radius: 8px;
    padding: 10px 16px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.85);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-width: 90vw;
}

.undo-toast.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.storage-warning-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    transform: translate(-50%, 20px);
    z-index: 10000;
    max-width: 90vw;
    background-color: #1a0d0d;
    color: #ff6b6b;
    border: 2px solid #ff6b6b;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 13px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.85);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.storage-warning-toast.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

.undo-toast-text {
    color: #eee;
    font-size: 0.82rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60vw;
}

.undo-toast-btn {
    flex-shrink: 0;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 5px;
    padding: 5px 12px;
    font-size: 0.78rem;
    font-weight: bold;
    cursor: pointer;
}

.undo-toast-btn:hover {
    background-color: #222222;
}

#landing-chat-area {
    position: fixed;
    top: 20vh;
    bottom: calc(13vh - 40px);
    left: 14vw;
    right: 14vw;
    z-index: 50;
    min-width: 0;
    box-sizing: border-box;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    border: 2px solid var(--renegade-accent);
    box-shadow: 0 0 15px var(--renegade-accent);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#landing-feed-tabs {
    flex-shrink: 0;
}

#landing-feed-list {
    flex: 1;
    min-height: 0;
}

button {
    background: none;
    border: 1px solid var(--renegade-accent);
    color: var(--renegade-accent);
    padding: 6px 12px;
    cursor: pointer;
    transition: 0.3s;
}

.chat-search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding: 6px 8px;
    background: #000;
    border: 1px solid var(--renegade-accent);
    border-radius: 8px;
    box-sizing: border-box;
}

.chat-search-input {
    flex: 1 1 auto;
    min-width: 0;
    background: #000;
    border: 1px solid #444;
    color: var(--renegade-accent);
    padding: 4px 8px;
    border-radius: 5px;
    outline: none;
    font-size: 13px;
}

.chat-search-input:focus {
    border-color: var(--renegade-accent);
}

.chat-search-count {
    color: #999;
    font-size: 11px;
    font-family: 'Courier New', monospace;
    min-width: 42px;
    text-align: center;
    flex-shrink: 0;
}

.chat-search-nav-btn {
    width: 26px;
    height: 26px;
    padding: 0;
    background: #111;
    color: var(--renegade-accent);
    border: 1px solid #444;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
}

.chat-search-nav-btn:hover {
    background: #222;
    border-color: var(--renegade-accent);
}

.chat-message.chat-search-match {
    outline: 1px dashed rgba(var(--renegade-accent-rgb), 0.5);
    outline-offset: 4px;
    border-radius: 8px;
}

.chat-message.chat-search-active {
    outline: 2px solid var(--renegade-accent);
    outline-offset: 4px;
    border-radius: 8px;
}

#chat-window {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    margin: 0;
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 14px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 12px;
    border: 2px solid var(--renegade-accent);
    box-shadow: 0 0 15px var(--renegade-accent);
}

.chat-message {
    position: relative;
    margin-bottom: 16px;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.edit-message-btn {
    position: absolute;
    top: 0;
    right: 0;
    width: 24px;
    height: 24px;
    padding: 0;
    background: rgba(0, 0, 0, 0.6);
    color: var(--renegade-accent);
    border: 1px solid #444;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    opacity: 0;
    transition: opacity 0.15s ease;
}

.chat-message:hover .edit-message-btn {
    opacity: 1;
}

.edit-message-btn:hover {
    background: #111;
    border-color: var(--renegade-accent);
}

.edit-message-textarea {
    display: block;
    width: 100%;
    min-height: 60px;
    max-height: 320px;
    background: #000;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 8px;
    padding: 8px 10px;
    box-sizing: border-box;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.4;
    resize: none;
    overflow-y: auto;
    outline: none;
}

.edit-message-actions {
    display: flex;
    gap: 8px;
    margin-top: 6px;
}

.edit-message-save-btn,
.edit-message-cancel-btn {
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    box-sizing: border-box;
}

.edit-message-save-btn {
    background: #111;
    color: var(--renegade-code-color);
    border: 1px solid var(--renegade-code-color);
}

.edit-message-save-btn:hover {
    background: var(--renegade-code-color);
    color: #000;
}

.edit-message-cancel-btn {
    background: #111;
    color: #999;
    border: 1px solid #444;
}

.edit-message-cancel-btn:hover {
    background: #222;
    color: #ccc;
}

/* Shared AI chat: "👋 bob joined the chat" (script.js addSharedChatNotice). */
.shared-chat-notice {
    display: table;
    margin: 4px auto 16px auto;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--renegade-accent);
    background-color: rgba(var(--renegade-accent-rgb, 57, 255, 20), 0.1);
    border: 1px solid rgba(var(--renegade-accent-rgb, 57, 255, 20), 0.35);
    text-align: center;
}

/* Shared AI chat: sender icon column (script.js addSharedChatAvatar). */
.chat-message.chat-message-with-avatar {
    padding-left: 44px;
    min-height: 34px;
}

.chat-message-avatar {
    position: absolute;
    top: 0;
    left: 0;
    width: 32px;
    height: 32px;
    box-sizing: border-box;
    border-radius: 50%;
    border: 1px solid var(--renegade-accent);
    background-color: #111111;
    object-fit: cover;
}

/* "Renegade: text" / "CarZoom10: text" in shared chats - name on the same line as the
   first line of the message; later paragraphs, code blocks and buttons flow below. */
.chat-message-sender-inline {
    font-weight: bold;
    color: var(--renegade-accent);
    margin-right: 6px;
}

.chat-message.chat-message-named > .chat-message-content {
    display: inline;
}

.chat-message.chat-message-named > .chat-message-content > p:first-child {
    display: inline;
    margin-top: 0;
}

.chat-message.chat-message-named > .chat-message-content > p:first-child + * {
    margin-top: 10px;
}

.chat-message.chat-message-named > .voice-speak-btn,
.chat-message.chat-message-named > .chat-message-voice-clip {
    display: flex;
    margin-top: 8px;
}

.chat-message.chat-message-named > .voice-speak-btn {
    width: 26px;
}

.chat-message-avatar-clickable {
    cursor: pointer;
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.chat-message-avatar-clickable:hover,
.chat-message-avatar-clickable:focus-visible {
    transform: scale(1.08);
    box-shadow: 0 0 8px var(--renegade-accent);
    outline: none;
}

.chat-message-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--renegade-accent);
    font-size: 14px;
    font-weight: bold;
}

.chat-message-sender {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
}

.chat-message-content {
    display: block;
}

.user-message .chat-message-sender {
    color: var(--renegade-accent);
}

.assistant-message .chat-message-sender {
    color: var(--renegade-accent);
}

.assistant-message .chat-message-content {
    color: var(--renegade-assistant-color);
}

.chat-message-reasoning {
    margin-bottom: 8px;
    border: 1px solid #444;
    border-radius: 6px;
    background: #0a0a0a;
    padding: 2px 8px;
}

.chat-message-reasoning summary {
    color: #999;
    font-size: 0.75rem;
    cursor: pointer;
    padding: 4px 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    outline: none;
}

.chat-message-reasoning summary:hover {
    color: var(--renegade-accent);
}

.chat-message-reasoning-content {
    color: #888;
    font-size: 0.78rem;
    line-height: 1.5;
    white-space: pre-wrap;
    padding: 4px 0 8px;
    border-top: 1px solid #333;
    margin-top: 2px;
}

.regenerate-label {
    color: #888;
    font-size: 0.75rem;
    font-style: italic;
    margin-bottom: 6px;
}

.compare-card {
    border: 1px solid var(--renegade-accent);
    border-radius: 8px;
    background: #050505;
    box-shadow: 0 0 8px rgba(var(--renegade-accent-rgb), 0.2);
    margin: 12px 0;
    padding: 10px 12px;
    box-sizing: border-box;
}

.compare-card-header {
    color: var(--renegade-accent);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.compare-card-prompt {
    color: #ccc;
    font-size: 0.85rem;
    font-style: italic;
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid #333;
}

.compare-card-columns {
    display: flex;
    gap: 10px;
}

.compare-card-column {
    flex: 1;
    min-width: 0;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 8px;
    background: #020202;
}

.compare-card-column-title {
    color: var(--renegade-accent);
    font-size: 0.72rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.compare-card-column-body {
    color: var(--renegade-assistant-color);
    font-size: 0.85rem;
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.compare-card-column-meta {
    display: none;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 8px;
    padding-top: 6px;
    border-top: 1px solid #333;
}

.compare-card-meta-item {
    color: #999;
    font-size: 0.7rem;
    font-family: 'Courier New', monospace;
}

.compare-card-column-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.compare-card-action-btn {
    flex: 1;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 5px;
    padding: 5px;
    font-size: 0.7rem;
    cursor: pointer;
}

.compare-card-action-btn:hover:not(:disabled) {
    background-color: #222222;
}

.compare-card-action-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.compare-card-vote-row {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #333;
    flex-wrap: wrap;
}

.compare-card-vote-label {
    color: #999;
    font-size: 0.75rem;
    width: 100%;
    text-align: center;
    margin-bottom: 4px;
}

.compare-card-vote-btn {
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 0.78rem;
    font-weight: bold;
    cursor: pointer;
}

.compare-card-vote-btn:hover {
    background-color: var(--renegade-accent);
    color: #000;
}

.file-preview-message .chat-message-sender {
    color: var(--renegade-accent);
}

.file-preview-image {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(var(--renegade-accent-rgb), 0.4);
}

.markdown-content {
    line-height: 1.55;
    color: var(--renegade-assistant-color);
    min-width: 0;
}

.user-message .markdown-content {
    color: var(--renegade-accent);
}

.user-message .markdown-content strong {
    color: var(--renegade-accent);
}

.markdown-content p {
    margin: 0 0 10px 0;
}

.markdown-content p:last-child {
    margin-bottom: 0;
}

.markdown-content ul,
.markdown-content ol {
    margin-top: 6px;
    margin-bottom: 10px;
    padding-left: 25px;
}

.markdown-content li {
    margin-bottom: 4px;
}

.markdown-content h1,
.markdown-content h2,
.markdown-content h3,
.markdown-content h4 {
    color: var(--renegade-assistant-color);
    margin-top: 14px;
    margin-bottom: 8px;
}

.user-message .markdown-content h1,
.user-message .markdown-content h2,
.user-message .markdown-content h3,
.user-message .markdown-content h4 {
    color: var(--renegade-accent);
}

.markdown-content strong {
    color: var(--renegade-assistant-color);
}

.markdown-content em {
    color: inherit;
    font-style: italic;
}

.inline-code {
    font-family: 'Courier New', monospace;
    color: var(--renegade-assistant-color);
    background: rgba(143, 220, 255, 0.08);
    border: 1px solid rgba(143, 220, 255, 0.25);
    border-radius: 4px;
    padding: 1px 5px;
}

.user-message .inline-code {
    color: var(--renegade-accent);
    background: rgba(var(--renegade-accent-rgb), 0.08);
    border: 1px solid rgba(var(--renegade-accent-rgb), 0.25);
}

.code-block-wrapper {
    margin: 12px 0;
    border: 1px solid var(--renegade-accent);
    border-radius: 8px;
    background: #050505;
    overflow: hidden;
    box-shadow: 0 0 8px rgba(var(--renegade-accent-rgb), 0.2);
    color: var(--renegade-code-color);
    max-width: 100%;
}

.code-block-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 30px;
    padding: 4px 8px;
    background: #111;
    border-bottom: 1px solid #333;
    box-sizing: border-box;
}

.code-block-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.code-block-label-group {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    overflow: hidden;
}

.code-filename {
    color: #eee;
    font-family: 'Courier New', monospace;
    font-size: 0.78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.code-language {
    color: var(--renegade-accent);
    font-family: 'Courier New', monospace;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    flex-shrink: 0;
}

.generate-code-message {
    max-width: 100%;
}

.generate-code-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.generate-code-title {
    color: var(--renegade-accent);
    font-weight: bold;
    font-size: 0.95rem;
}

.generate-code-regen-btn {
    background: none;
    border: 1px solid #444;
    color: #ccc;
    border-radius: 5px;
    padding: 3px 8px;
    cursor: pointer;
    font-size: 0.85rem;
}

.generate-code-regen-btn:hover {
    border-color: var(--renegade-accent);
    color: var(--renegade-accent);
}

.generate-code-regen-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.generate-code-meta {
    color: #888;
    font-size: 0.75rem;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
}

.generate-code-empty {
    color: #666;
    font-size: 0.85rem;
    font-style: italic;
    padding: 6px 0;
}

.generate-code-error {
    color: #ff6b6b;
    font-size: 0.85rem;
    padding: 6px 0;
}

.generate-code-save-all-btn {
    display: block;
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    background: #111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}

.generate-code-save-all-btn:hover {
    background: var(--renegade-accent);
    color: #000;
}

.copy-code-btn,
.download-code-btn,
.view-html-btn {
    background: none;
    border: 1px solid var(--renegade-accent);
    color: var(--renegade-accent);
    border-radius: 5px;
    padding: 3px 8px;
    font-size: 0.7rem;
    cursor: pointer;
}

.copy-code-btn:hover,
.download-code-btn:hover,
.view-html-btn:hover {
    background: var(--renegade-accent);
    color: #000;
}

.code-block {
    display: block;
    margin: 0;
    padding: 12px;
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
    background: #020202;
    color: var(--renegade-code-color);
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.88rem;
    line-height: 1.5;
    tab-size: 4;
    white-space: pre;
    word-wrap: normal;
    overflow-wrap: normal;
}

.code-block code {
    font-family: inherit;
    white-space: inherit;
    color: var(--renegade-code-color);
}

.markdown-content .code-block-wrapper,
.markdown-content .code-block-wrapper * {
    color: inherit;
}

.markdown-content .code-block-wrapper .code-language,
.markdown-content .code-block-wrapper .copy-code-btn,
.markdown-content .code-block-wrapper .download-code-btn,
.markdown-content .code-block-wrapper .view-html-btn {
    color: var(--renegade-accent);
}

.markdown-content .code-block-wrapper .code-block,
.markdown-content .code-block-wrapper .code-block code {
    color: var(--renegade-code-color);
}

#docs-panel.docs-panel {
    width: 380px;
    max-width: 92vw;
    max-height: 82vh;
    overflow-y: auto;
    padding: 0;
}

#docs-panel-content {
    padding: 16px;
}

.docs-panel-close-button {
    display: block;
    width: calc(100% - 32px);
    margin: 0 16px 16px;
    padding: 8px;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    box-sizing: border-box;
}

.docs-panel-close-button:hover {
    background-color: #222222;
}

.renegade-docs-panel {
    color: #eee;
    font-size: 13px;
}

.renegade-docs-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.renegade-docs-title {
    color: var(--renegade-accent);
    font-size: 17px;
    font-weight: bold;
}

.renegade-docs-subtitle {
    color: #888;
    font-size: 11px;
    margin-top: 2px;
    word-break: break-all;
}

.renegade-docs-status {
    flex-shrink: 0;
    color: var(--renegade-code-color);
    font-family: 'Courier New', monospace;
    font-size: 10px;
    letter-spacing: 1px;
    border: 1px solid var(--renegade-code-color);
    border-radius: 4px;
    padding: 2px 6px;
    height: fit-content;
}

.renegade-docs-section {
    margin-bottom: 14px;
}

.renegade-docs-section-title {
    color: #999;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.renegade-docs-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.renegade-docs-tag {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #111111;
    border: 1px solid var(--renegade-accent);
    color: var(--renegade-accent);
    border-radius: 5px;
    padding: 4px 8px;
    font-size: 12px;
    cursor: default;
}

.renegade-docs-tag small {
    color: var(--renegade-code-color);
    font-family: 'Courier New', monospace;
}

.renegade-docs-versions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}

.renegade-docs-version {
    background: #0a0a0a;
    border: 1px solid #444;
    color: #ccc;
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    font-family: 'Courier New', monospace;
}

.renegade-docs-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.renegade-docs-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #0a0a0a;
    border: 1px solid #333;
    color: var(--renegade-accent);
    border-radius: 5px;
    padding: 6px 10px;
    font-size: 12px;
    text-decoration: none;
}

.renegade-docs-link:hover {
    border-color: var(--renegade-accent);
    background: #111111;
}

.renegade-docs-link small {
    color: var(--renegade-code-color);
    font-family: 'Courier New', monospace;
    font-size: 10px;
    flex-shrink: 0;
}

.renegade-docs-sources {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.renegade-docs-source {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    background: #0a0a0a;
    border: 1px solid #333;
    color: #eee;
    border-radius: 5px;
    padding: 6px 10px;
    font-size: 12px;
    text-decoration: none;
}

.renegade-docs-source:hover {
    border-color: var(--renegade-accent);
}

.renegade-docs-source strong {
    color: var(--renegade-accent);
    font-weight: normal;
}

.renegade-docs-source small {
    color: #888;
    flex-shrink: 0;
}

.renegade-docs-empty {
    color: #666;
    font-size: 12px;
    font-style: italic;
}

.renegade-docs-actions {
    margin-top: 4px;
}

.renegade-docs-ask {
    width: 100%;
    padding: 10px;
    background-color: #111111;
    color: var(--renegade-code-color);
    border: 1px solid var(--renegade-code-color);
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    box-sizing: border-box;
}

.renegade-docs-ask:hover {
    background-color: var(--renegade-code-color);
    color: #000;
}

.docs-send-immediately-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: #999;
    font-size: 11px;
    cursor: pointer;
}

.docs-send-immediately-row input[type="checkbox"] {
    accent-color: var(--renegade-accent);
    cursor: pointer;
}

.account-panel-toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 4px 0 4px;
    padding-top: 12px;
    border-top: 1px solid #333;
    color: #ccc;
    font-size: 13px;
    cursor: pointer;
}

.account-panel-toggle-row input[type="checkbox"] {
    accent-color: var(--renegade-accent);
    cursor: pointer;
    width: 16px;
    height: 16px;
}

/* Chat panel's title row: "Chat" on the left, quick-access voice/reply-length
   toggles on the right, all in the same top row (see speech.js's
   buildChatQuickToggles). Scoped to .chat-panel only - .renegade-modal-title is
   shared by every panel and stays centered text everywhere else. */
.chat-panel .renegade-modal-title.chat-panel-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    text-align: left;
}

.chat-panel-titlebar-text {
    flex: 0 0 auto;
}

.chat-quick-toggles {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    align-items: center;
    gap: 4px 10px;
    flex: 1 1 auto;
    min-width: 0;
}

.chat-quick-toggles:empty {
    display: none;
}

.chat-quick-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    color: #999;
    font-size: 10px;
    font-weight: normal;
    cursor: pointer;
    white-space: nowrap;
}

.chat-quick-toggle input[type="checkbox"] {
    accent-color: var(--renegade-accent);
    cursor: pointer;
    width: 11px;
    height: 11px;
}

.chat-quick-voice-select {
    background-color: #111111;
    color: #999;
    border: 1px solid #444;
    border-radius: 4px;
    font-size: 10px;
    padding: 2px 4px;
    max-width: 160px;
    cursor: pointer;
}

.chat-quick-voice-select:hover,
.chat-quick-voice-select:focus {
    color: var(--renegade-accent);
    border-color: var(--renegade-accent);
}

.markdown-blockquote {
    border-left: 3px solid var(--renegade-accent);
    padding-left: 12px;
    margin: 10px 0;
    opacity: 0.9;
}

.markdown-table-wrapper {
    margin: 12px 0;
    overflow-x: auto;
    border: 1px solid #333;
    border-radius: 6px;
}

.markdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.markdown-table th,
.markdown-table td {
    padding: 6px 10px;
    text-align: left;
    border-bottom: 1px solid #333;
    white-space: nowrap;
}

.markdown-table th {
    background: #111;
    color: var(--renegade-accent);
    font-weight: bold;
    border-bottom: 1px solid var(--renegade-accent);
}

.markdown-table tbody tr:hover {
    background: rgba(var(--renegade-accent-rgb), 0.06);
}

.markdown-table tbody tr:last-child td {
    border-bottom: none;
}

.generation-stopped-badge {
    display: inline-block;
    margin-top: 8px;
    padding: 2px 8px;
    border: 1px solid #ff6b6b;
    border-radius: 4px;
    color: #ff6b6b;
    font-size: 11px;
    font-family: 'Courier New', monospace;
}

.input-bar {
    display: flex;
    gap: 10px;
    width: 100%;
    min-height: 30px;
    min-width: 0;
    margin-top: 1.2%;
    margin-left: 0;
    margin-right: 0;
    border-radius: 10px;
    align-items: flex-end;
    box-sizing: border-box;
}

#upload-btn {
    width: 110px !important;
    height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    flex-shrink: 0;
}

#user-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 0;
    height: 30px;
    max-height: 160px;
    min-height: 30px;
    background: #000;
    border: 1px solid var(--renegade-accent);
    color: var(--renegade-accent);
    padding: 6px 8px;
    border-radius: 10px;
    outline: none;
    box-sizing: border-box;
    resize: none;
    overflow-y: auto;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.3;
    white-space: pre-wrap;
}

#user-input:focus {
    box-shadow: 0 0 8px rgba(var(--renegade-accent-rgb), 0.35);
}

#user-input::placeholder {
    color: rgba(var(--renegade-accent-rgb), 0.55);
}

#regenerate-btn {
    width: 46px !important;
    height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    flex-shrink: 0;
}

#send-btn,
#stop-btn {
    border-radius: 10px;
    flex-shrink: 0;
}

#stop-btn:hover {
    background: var(--renegade-accent);
    color: #000;
}

/* Speech (STT/TTS), scripts/speech.js - the mic button lands as a plain sibling right
   after #user-input / #coding-chat-input, so it inherits each input bar's own layout
   (the flex row here, the CSS-grid layout at mobile widths) without needing a wrapper. */
.voice-mic-btn {
    width: 36px !important;
    height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    flex-shrink: 0;
    font-size: 14px;
    background: #000;
    color: var(--renegade-accent);
    cursor: pointer;
}

body.voice-mic-disabled .voice-mic-btn {
    display: none !important;
}

.voice-mic-btn:hover:not(:disabled) {
    background-color: var(--renegade-accent) !important;
    color: #000 !important;
    box-shadow: 0 0 15px var(--renegade-accent), 0 0 30px rgba(var(--renegade-accent-rgb), 0.7) !important;
    border-color: var(--renegade-accent) !important;
}

.voice-mic-btn.voice-listening {
    background: var(--renegade-accent) !important;
    color: #000 !important;
    animation: voice-mic-pulse 1.2s ease-in-out infinite;
}

@keyframes voice-mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(var(--renegade-accent-rgb), 0.55); }
    50% { box-shadow: 0 0 0 7px rgba(var(--renegade-accent-rgb), 0); }
}

.voice-speak-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 6px;
    width: 26px;
    height: 26px;
    padding: 0;
    border-radius: 8px;
    border: 1px solid #444;
    background: #0a0a0a;
    color: var(--renegade-accent);
    font-size: 12px;
    cursor: pointer;
}

.voice-speak-btn:hover {
    border-color: var(--renegade-accent);
    background: #151515;
}

.voice-speak-btn.voice-speaking {
    background: var(--renegade-accent);
    color: #000;
    border-color: var(--renegade-accent);
}

/* Floating "AI is talking" badge, scripts/speech.js - visible for the whole time
   anything is playing (auto-talk-back or a manual 🔊 click), independent of the
   per-message button. A bouncing-bars indicator so it reads as sound at a glance. */
.voice-talking-indicator {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 9999;
    display: none;
    align-items: flex-end;
    gap: 4px;
    height: 24px;
    padding: 10px 14px;
    background: #0a0a0a;
    border: 1px solid var(--renegade-accent);
    border-radius: 999px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    pointer-events: none;
}

.voice-talking-indicator.voice-talking-indicator-active {
    display: flex;
}

.voice-talking-bar {
    width: 4px;
    height: 6px;
    background: var(--renegade-accent);
    border-radius: 2px;
    animation: voice-talking-bounce 0.9s ease-in-out infinite;
}

.voice-talking-bar:nth-child(2) {
    animation-delay: 0.15s;
}

.voice-talking-bar:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes voice-talking-bounce {
    0%, 100% { height: 6px; }
    50% { height: 18px; }
}

/* Keeps a live reply's real text hidden behind a "Thinking..." placeholder while
   auto-speak will read it, so the text appears at the same moment the voice starts
   instead of the person reading ahead of it. See speech.js's watchForAutoSpeak. */
.chat-message.voice-pending-reveal .chat-message-content,
.chat-message.voice-pending-reveal .chat-message-reasoning {
    display: none;
}

.voice-thinking-placeholder {
    display: none;
    color: var(--renegade-muted, #999);
    font-style: italic;
    opacity: 0.85;
}

.chat-message.voice-pending-reveal .voice-thinking-placeholder {
    display: block;
}

button:disabled,
#user-input:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

button,
#send-btn,
#history-btn,
#login-btn {
    transition: all 0.25s ease;
    border-radius: 10px;
    border: 1px solid var(--renegade-accent);
}

#upload-btn:hover:not(:disabled),
#regenerate-btn:hover:not(:disabled),
#send-btn:hover:not(:disabled),
.left-nav > button:hover:not(:disabled) {
    background-color: var(--renegade-accent) !important;
    color: #000 !important;
    box-shadow: 0 0 15px var(--renegade-accent), 0 0 30px rgba(var(--renegade-accent-rgb), 0.7) !important;
    border-color: var(--renegade-accent) !important;
    cursor: pointer !important;
}

#reasoning-controls-panel #reasoning-reasonable-btn,
#reasoning-controls-panel #reasoning-balanced-btn,
#reasoning-controls-panel #reasoning-unreasonable-btn {
    width: 100%;
}

#reasoning-controls-panel #reasoning-close-btn {
    width: 50px !important;
    height: 30px !important;
    padding: 4px 8px;
    margin: 2px auto 0 auto;
    font-size: 11px;
    border-radius: 5px;
    box-sizing: border-box;
}

.particle {
    position: fixed;
    width: 3px;
    height: 3px;
    background-color: var(--renegade-accent);
    border-radius: 50%;
    pointer-events: none;
    z-index: 1;
    animation: particleMove 6s linear infinite;
}

@keyframes particleMove {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) translateX(20vw);
        opacity: 0;
    }
}

#chat-window::-webkit-scrollbar,
.file-list::-webkit-scrollbar,
.history-listbox::-webkit-scrollbar,
.code-block::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

#chat-window::-webkit-scrollbar-track,
.file-list::-webkit-scrollbar-track,
.history-listbox::-webkit-scrollbar-track,
.code-block::-webkit-scrollbar-track {
    background: #050505;
}

#chat-window::-webkit-scrollbar-thumb,
.file-list::-webkit-scrollbar-thumb,
.history-listbox::-webkit-scrollbar-thumb,
.code-block::-webkit-scrollbar-thumb {
    background: var(--renegade-accent);
    border-radius: 6px;
}

#settings-btn .settings-gear-icon {
    color: #999999;
    font-size: 18px;
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

button:not(.renegade-modal-close-button):not(.docs-panel-close-button):not(.project-file-delete-btn):not(.file-item-btn-danger):not(.renegade-btn-danger):not(.login-google-button):not(.login-facebook-button):not(.find-bug-severity-toggle):not(.theme-swatch):not(.admin-nav-tab):not(.renegade-modal-close-x):not(.renegade-modal-settings-btn):not(.renegade-modal-minimize-btn):not(.friend-profile-panel-like-btn):not(.media-fullscreen-like-btn):not(.media-fullscreen-close-btn):not(.renegade-modal-back-btn):not(.media-fullscreen-delete-btn):not(.friend-chat-action-btn):not(.friend-chat-close-btn):not(.friend-chat-reply-preview-cancel):not(.friend-chat-message-menu-emoji-option):not(.unread-messages-dropdown-row):not(.profile-panel-add-post-image-preview-remove):not(.unread-messages-badge):not(.reaction-bell-btn):not(.feed-tab):not(.feed-card-action-btn):not(.feed-card-menu-btn-trigger):not(.feed-panel-close-btn):not(.renegade-video-embed-play):not(.rc-btn):not(.rc-control-btn) {
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
}

button:not(.renegade-modal-close-button):not(.docs-panel-close-button):not(.project-file-delete-btn):not(.file-item-btn-danger):not(.renegade-btn-danger):not(.login-google-button):not(.login-facebook-button):not(.find-bug-severity-toggle):not(.theme-swatch):not(.admin-nav-tab):not(.renegade-modal-close-x):not(.renegade-modal-settings-btn):not(.renegade-modal-minimize-btn):not(.friend-profile-panel-like-btn):not(.media-fullscreen-like-btn):not(.media-fullscreen-close-btn):not(.renegade-modal-back-btn):not(.media-fullscreen-delete-btn):not(.friend-chat-action-btn):not(.friend-chat-close-btn):not(.friend-chat-reply-preview-cancel):not(.friend-chat-message-menu-emoji-option):not(.unread-messages-dropdown-row):not(.profile-panel-add-post-image-preview-remove):not(.unread-messages-badge):not(.reaction-bell-btn):not(.feed-tab):not(.feed-card-action-btn):not(.feed-card-menu-btn-trigger):not(.feed-panel-close-btn):not(.renegade-video-embed-play):not(.rc-btn):not(.rc-control-btn):hover:not(:disabled) {
    background-color: var(--renegade-accent) !important;
    color: #000 !important;
    box-shadow: 0 0 15px var(--renegade-accent), 0 0 30px rgba(var(--renegade-accent-rgb), 0.7) !important;
    border-color: var(--renegade-accent) !important;
    cursor: pointer !important;
}

.renegade-modal-close-button,
.docs-panel-close-button {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 34px;
    margin-top: 8px;
    padding: 8px;
    background-color: #1a0000;
    color: #ff5c5c;
    border: 1px solid #ff5c5c;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    box-sizing: border-box;
}

.renegade-modal-close-button:hover:not(:disabled),
.docs-panel-close-button:hover:not(:disabled) {
    background-color: #ff5c5c !important;
    color: #1a0000 !important;
    box-shadow: 0 0 12px #ff5c5c, 0 0 24px #ff2222 !important;
    border-color: #ff2222 !important;
    cursor: pointer !important;
}

.project-file-delete-btn,
.file-item-btn-danger,
.renegade-btn-danger {
    background-color: #1a0000 !important;
    color: #ff5c5c !important;
    border: 1px solid #ff5c5c !important;
}

.project-file-delete-btn:hover:not(:disabled),
.file-item-btn-danger:hover:not(:disabled),
.renegade-btn-danger:hover:not(:disabled) {
    background-color: #ff5c5c !important;
    color: #1a0000 !important;
    box-shadow: 0 0 10px #ff5c5c, 0 0 20px #ff2222 !important;
    border-color: #ff2222 !important;
    cursor: pointer !important;
}

.file-item-btn.file-item-btn-danger {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

button:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none !important;
}

button,
.file-item-icon,
.history-item-icon,
.left-nav > button,
.settings-gear-icon {
    /* Text fonts FIRST, emoji fonts after. With the emoji fonts first, they also drew
       the letters and spaces - and their space character is extra wide on phones, which
       is what put big gaps between words ("Log     In"). Emoji still use the color
       emoji fonts because the text fonts don't have them. */
    font-family: "Orbitron", sans-serif, "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", "Twemoji Mozilla";
    font-variant-emoji: emoji;
}

    #friends-list .friend-row-button,
    #right-nav-friends-list .friend-row-button {
        padding: 3px 8px;
        font-size: 11px;
        border-radius: 6px;
    }

    
    .friend-profile-panel-avatar-wrap {
        display: flex;
        justify-content: center;
        margin: 2px 0 3px;
    }

    .friend-profile-panel-username {
        text-align: center;
        font-weight: bold;
        font-size: 16px;
        color: var(--renegade-accent);
        margin-bottom: 0;
    }

    .friend-profile-panel-bio {
        text-align: center;
        font-size: 13px;
        line-height: 1.4;
        margin-bottom: 0;
        word-break: break-word;
    }

    
    #friend-profile-panel .profile-panel-stats {
        margin: 0 0 6px;
        padding: 1px 0 4px;
    }

    
    .profile-panel-avatar-wrap {
        display: flex;
        justify-content: center;
    }

    .profile-panel-avatar-preview {
        margin: 0 auto 12px auto !important;
    }

    .profile-panel-avatar-placeholder {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 120px;
        height: 120px;
        border-radius: 50%;
        border: 2px solid var(--renegade-accent);
        background-color: #111111;
        margin: 0 auto 12px auto;
        font-size: 48px;
    }

    .profile-panel-label {
        font-size: 12px;
        opacity: 0.75;
        margin: 8px 0 4px;
        text-align: left;
    }

    .profile-panel-avatar-menu {
        display: none;
        flex-direction: column;
        align-items: center;
        gap: 6px;
        margin: 0 auto 10px auto;
    }



    .profile-panel-avatar-action-btn {
        width: 200px;
        box-sizing: border-box;
        text-align: center;
    }

    #profile-panel-avatar-status {
        text-align: center;
        margin: 0 0 6px;
    }

    .profile-panel-photos-btn-row {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
        margin: 0 0 12px;
    }



    .profile-panel-stats {
        display: flex;
        justify-content: space-around;
        margin: 4px 0 14px;
        padding: 10px 0;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .profile-panel-stat {
        text-align: center;
    }

    .profile-panel-stat-number {
        font-weight: bold;
        font-size: 15px;
    }

    .profile-panel-stat-label {
        font-size: 11px;
        opacity: 0.7;
        margin-top: 2px;
    }

    .profile-panel-tabs {
        display: flex;
        gap: 6px;
        margin-top: 16px;
    }

    
    .profile-panel-tab {
        flex: 1;
        opacity: 0.7;
        cursor: pointer;
        padding: 6px 0;
        font-size: 12px;
    }

    .profile-panel-tab.active {
        opacity: 1;
        background-color: var(--renegade-accent) !important;
        color: #000 !important;
    }

    .profile-panel-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 4px;
        margin-top: 4px;
    }

    .profile-panel-grid-tile {
        aspect-ratio: 1 / 1;
        background: #111111;
        border-radius: 4px;
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .profile-panel-grid-tile img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .profile-panel-grid-tile-video {
        font-size: 20px;
        color: var(--renegade-accent);
    }

    .profile-panel-grid-empty {
        grid-column: 1 / -1;
        text-align: center;
        font-size: 12px;
        opacity: 0.6;
        padding: 20px 0;
    }

    .profile-panel-newsfeed-label {
        font-size: 11px;
        opacity: 0.6;
        margin-top: 16px;
        margin-bottom: 6px;
    }

    
    .profile-panel-newsfeed {
        display: flex;
        flex-wrap: nowrap;
        gap: 6px;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
    }

    .profile-panel-newsfeed-box {
        flex: 0 0 auto;
        width: 56px;
        height: 56px;
        border-radius: 6px;
        background-color: #111111;
        border: 1px solid rgba(255, 255, 255, 0.1);
        overflow: hidden;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .profile-panel-newsfeed-box img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .profile-panel-newsfeed-box-video {
        position: relative;
        color: var(--renegade-accent);
        font-size: 16px;
    }

    .profile-panel-newsfeed-box-video video {
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .profile-panel-newsfeed-box-video-icon {
        position: relative;
        z-index: 1;
        text-shadow: 0 0 4px rgba(0, 0, 0, 0.9), 0 0 8px rgba(0, 0, 0, 0.9);
    }

    
    .friend-profile-panel-like-row {
        display: flex;
        justify-content: center;
        margin: 0;
    }

    .friend-profile-panel-like-btn {
        background: none;
        border: none;
        color: var(--renegade-accent);
        font-size: 26px;
        font-weight: bold;
        line-height: 1;
        letter-spacing: -1px;
        cursor: pointer;
        padding: 4px 12px;
        transition: transform 0.15s ease, opacity 0.15s ease;
    }

    .friend-profile-panel-like-btn:hover:not(:disabled) {
        transform: scale(1.15);
    }

    
    .friend-profile-panel-like-btn:disabled {
        opacity: 0.3;
        cursor: default;
        transform: none;
    }

    
    .profile-panel-button-row {
        display: flex;
        gap: 8px;
        margin-top: 4px;
    }

    .profile-panel-button-row .profile-panel-button-small {
        flex: 1;
        width: auto;
    }

    .profile-panel-button-small {
        padding: 6px !important;
        font-size: 11px !important;
        border-width: 1px !important;
        border-radius: 4px !important;
    }

    
    .profile-panel-button-secondary {
        opacity: 0.85;
    }

.renegade-modal-close-x {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 26px;
    height: 26px;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: #ff3b3b;
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    opacity: 0.85;
}

.renegade-modal-close-x:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.08);
}

.renegade-modal-settings-btn {
    position: absolute;
    top: 10px;
    right: 44px;
    width: 26px;
    height: 26px;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--renegade-accent, #ffffff);
    font-size: 15px;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    opacity: 0.85;
}

.renegade-modal-settings-btn:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.08);
}

.renegade-modal-minimize-btn {
    position: absolute;
    top: 10px;
    right: 76px;
    width: 26px;
    height: 26px;
    padding: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--renegade-accent, #ffffff);
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    opacity: 0.85;
}

.renegade-modal-minimize-btn:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.08);
}

.profile-panel-restore-pill {
    display: none;
    align-items: center;
    gap: 6px;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 999px;
    padding: 10px 16px;
    font-weight: bold;
    font-size: 13px;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
}

.profile-panel-restore-pill:hover {
    background-color: #222222;
}

.profile-settings-panel {
    width: 300px;
    /* Layers in front of the still-open profile page behind it - both
       share .renegade-modal-panel's z-index of 9999, so this needs to be
       explicitly higher rather than relying on DOM order. */
    z-index: 10000;
}

.profile-settings-section-label {
    color: var(--renegade-accent, #ffffff);
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 10px;
}

.profile-settings-visibility-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.profile-settings-visibility-option {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    background-color: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
}

.profile-settings-visibility-option:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.profile-settings-visibility-option.active {
    border-color: var(--renegade-accent, #ffffff);
    background-color: rgba(255, 255, 255, 0.1);
}

.profile-settings-visibility-option-label {
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
}

.profile-settings-visibility-option-desc {
    color: rgba(255, 255, 255, 0.65);
    font-size: 12px;
    margin-top: 2px;
}

.profile-settings-status {
    text-align: center;
    font-size: 12px;
    margin-top: 10px;
}

.media-fullscreen-like-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 0;
}

.media-fullscreen-like-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.media-fullscreen-like-btn:hover {
    transform: scale(1.12);
}

.media-fullscreen-like-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    
    opacity: 0.5;
    filter: grayscale(60%);
    transition: opacity 0.15s ease, filter 0.15s ease;
}

.media-fullscreen-like-btn.liked .media-fullscreen-like-icon {
    opacity: 1;
    filter: none;
}

.media-fullscreen-like-count {
    color: #fff;
    font-size: 13px;
    font-weight: bold;
}

.friend-profile-panel-like-icon {
    width: 94px;
    height: 94px;
    object-fit: contain;
    border: none;
    outline: none;
}

.friend-like-toast-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}


.friend-like-toast-icon-emoji {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    line-height: 1;
}

.friend-like-toast-status {
    color: var(--renegade-accent);
}

.friend-chat-attachment-image-link {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.friend-chat-attachment-video-wrap {
    position: relative;
    display: inline-block;
    margin-top: 6px;
}

.friend-chat-attachment-video {
    display: block;
    max-width: 240px;
    max-height: 240px;
    border-radius: 8px;
    background-color: #000000;
}

.friend-chat-attachment-expand-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    color: #fff;
    font-size: 13px;
    cursor: pointer;
}

.friend-chat-attachment-expand-btn:hover {
    background-color: rgba(0, 0, 0, 0.85);
}

.friend-chat-voice-message {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 2px;
}

.friend-chat-voice-message audio {
    display: none;
}

.friend-chat-voice-message-icon {
    font-size: 16px;
    line-height: 1;
    opacity: 0.8;
}

.friend-chat-voice-message-play-btn {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    font-size: 13px;
    cursor: pointer;
}

.friend-chat-mic-btn {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
}

.friend-chat-mic-btn:hover {
    background-color: #222222;
}

.friend-chat-mic-btn.recording {
    background-color: #3a0000;
    border-color: #ff3b3b;
    color: #ff3b3b;
    animation: friend-chat-mic-pulse 1.1s ease-in-out infinite;
}

.friend-chat-mic-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

@keyframes friend-chat-mic-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.friend-chat-input-row {
    touch-action: pan-y;
}

.profile-panel-add-post-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin: 10px 0;
}

.profile-panel-add-post-caption {
    width: 100%;
    box-sizing: border-box;
    font-size: 12px;
}

.profile-panel-add-post-btn-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-panel-add-post-btn-row .profile-panel-add-post-btn {
    flex: 1;
}

.media-fullscreen-caption {
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
    text-align: center;
    max-width: 420px;
    margin: 8px 0 0;
    word-break: break-word;
}

.media-fullscreen-comments-section {
    width: 100%;
    max-width: 420px;
    margin-top: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding-top: 0;
}

.media-fullscreen-comments-label {
    background: none;
    border: none;
    color: var(--renegade-accent);
    font-size: 13px;
    padding: 4px 0;
    display: block;
}

.media-fullscreen-comments-body {
    margin-top: 6px;
}

.media-fullscreen-comments-list {
    max-height: 180px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
}

.media-fullscreen-comment {
    font-size: 12px;
    line-height: 1.4;
    color: #fff;
    word-break: break-word;
}

.media-fullscreen-comment-username {
    color: var(--renegade-accent);
    font-weight: bold;
    margin-right: 6px;
}

.media-fullscreen-comments-empty {
    font-size: 12px;
    opacity: 0.6;
    text-align: center;
    padding: 6px 0;
}

.media-fullscreen-comment-form {
    display: flex;
    gap: 6px;
}

.media-fullscreen-comment-input {
    flex: 1;
    padding: 6px 10px;
    background-color: #111111;
    color: #fff;
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    font-size: 12px;
    box-sizing: border-box;
}

.media-fullscreen-comment-input:focus {
    outline: none;
    box-shadow: 0 0 0 1px var(--renegade-accent);
}

.media-fullscreen-comment-submit-btn {
    background: none;
    border: 1px solid var(--renegade-accent);
    color: var(--renegade-accent);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
}

#photo-gallery-panel {
    max-height: 80vh;
    overflow-y: auto;
}

.friend-profile-panel-action-row {
    display: flex;
    gap: 8px;
    margin: 4px 0;
}

.friend-profile-panel-action-btn {
    flex: 1;
    padding: 6px 8px;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    cursor: pointer;
    font-size: 11px;
    text-align: center;
    box-sizing: border-box;
}

.friend-profile-panel-action-btn:hover {
    background-color: #222222;
}

.profile-panel-grid-tile-text {
    background-color: #161616;
    padding: 6px;
    box-sizing: border-box;
}

.profile-panel-grid-tile-text-preview {
    font-size: 10px;
    line-height: 1.3;
    color: #fff;
    text-align: center;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.profile-panel-newsfeed-box-text {
    font-size: 18px;
}

.media-fullscreen-text-post {
    max-width: 420px;
    padding: 24px 20px;
    color: #fff;
    font-size: 18px;
    line-height: 1.5;
    text-align: center;
    word-break: break-word;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    background-color: #111111;
}


.media-fullscreen-text-post-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
    max-width: 480px;
}


.renegade-video-embed {
    width: 100%;
    max-width: 480px;
    margin: 8px auto 0;
}

.renegade-video-embed-inner {
    position: relative;
    width: 100%;
    padding-top: 56.25%; 
    background-color: #000;
    border-radius: 8px;
    overflow: hidden;
}

.renegade-video-embed-inner iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}


.renegade-video-embed-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}


.renegade-video-embed-thumb-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a1a, #2c2c2c);
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.renegade-video-embed-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-sizing: border-box;
    width: 56px;
    height: 56px;
    padding: 0;
    
    background: none !important;
    border: none !important;
    color: #fff;
    font-size: 34px;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.85), 0 0 14px rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: none;
}


.renegade-video-embed-watch-link {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--renegade-accent);
    text-align: center;
    text-decoration: none;
}

.renegade-video-embed-watch-link:hover {
    text-decoration: underline;
}

.friend-chat-message-link {
    color: inherit;
    text-decoration: underline;
    word-break: break-all;
}

.renegade-modal-back-btn {
    position: absolute;
    top: 10px;
    right: 42px;
    min-width: 30px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    color: var(--renegade-accent);
    font-size: 13px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    padding: 0 4px;
    opacity: 0.85;
}

.renegade-modal-back-btn:hover {
    opacity: 1;
}

.profile-panel-add-post-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-panel-add-post-caption-row {
    margin-top: 8px;
}

.profile-panel-add-post-input-row .profile-panel-add-post-caption {
    flex: 1;
    min-width: 0;
    height: 34px;
    padding: 0 10px;
    border-width: 1px;
    box-sizing: border-box;
}

.profile-panel-add-post-input-row .profile-panel-add-post-btn {
    flex-shrink: 0;
    height: 34px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.profile-panel-add-post-image-preview {
    display: none;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 6px;
    background-color: #111111;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 6px;
}

.profile-panel-add-post-image-preview-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
}

.profile-panel-add-post-image-preview-remove {
    margin-left: auto;
    background: none;
    border: none;
    color: #ff3b3b;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 8px;
}


.profile-panel-add-post-video-preview {
    display: none;
    margin-top: 8px;
}

.profile-panel-add-post-video-file-preview-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: 4px;
    display: block;
    background-color: #000000;
}

/* Standard-size centered panel on desktop/computer (not maximized -
   the full-viewport treatment below is mobile-only, in mobile.css). */
#profile-panel,
#friend-profile-panel {
    width: 90%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

#profile-panel::-webkit-scrollbar,
#friend-profile-panel::-webkit-scrollbar {
    display: none;
}

#profile-panel.open,
#friend-profile-panel.open {
    display: flex !important;
    flex-direction: column;
    align-items: center;
}

#profile-panel > *:not(.renegade-modal-close-x):not(.renegade-modal-back-btn):not(.renegade-modal-settings-btn):not(.renegade-modal-minimize-btn),
#friend-profile-panel > *:not(.renegade-modal-close-x):not(.renegade-modal-back-btn):not(.renegade-modal-settings-btn):not(.renegade-modal-minimize-btn) {
    width: 100%;
    max-width: 480px;
    box-sizing: border-box;
    /* Never squash sections to fit a short window (the "Recent" strip was being
       crushed to a few pixels on smaller screens) - the panel scrolls instead. */
    flex-shrink: 0;
}

.media-fullscreen-delete-btn {
    display: none;
    width: 100%;
    max-width: 420px;
    margin-top: 10px;
    padding: 8px;
    background-color: #1a0000;
    color: #ff5c5c;
    border: 1px solid #ff5c5c;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    box-sizing: border-box;
}

.media-fullscreen-delete-btn:hover:not(:disabled) {
    background-color: #ff5c5c;
    color: #1a0000;
    box-shadow: 0 0 12px #ff5c5c, 0 0 24px #ff2222;
    border-color: #ff2222;
}

.media-fullscreen-delete-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.friend-profile-panel-action-row {
    justify-content: center;
}

.friend-profile-panel-action-btn {
    flex: 0 1 auto;
    min-width: 100px;
}

.friend-chat-action-btn {
    background: none !important;
    border: none !important;
}

.friend-chat-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.08) !important;
}

.friend-chat-close-btn {
    background: none !important;
    border: none !important;
    color: #ff3b3b !important;
}

.friend-chat-close-btn:hover {
    background-color: rgba(255, 59, 59, 0.15) !important;
    color: #ff3b3b !important;
}

.friend-chat-reply-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    margin-top: 8px;
    background-color: #111111;
    border-left: 3px solid var(--renegade-accent);
    border-radius: 4px;
    font-size: 12px;
}

.friend-chat-reply-preview-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #ccc;
}

.friend-chat-reply-preview-cancel {
    background: none;
    border: none;
    color: #ff3b3b;
    cursor: pointer;
    font-size: 12px;
    flex-shrink: 0;
    padding: 0 2px;
}

.friend-chat-voice-preview-play-btn {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 50%;
    font-size: 11px;
    cursor: pointer;
}

.friend-chat-message {
    touch-action: pan-y;
}

.feed-panel-titlebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 22px;
    border-bottom: 1px solid rgba(var(--renegade-accent-rgb), 0.25);
    flex-shrink: 0;
}

.feed-panel-title {
    font-size: 18px;
    font-weight: bold;
    color: var(--renegade-accent);
    letter-spacing: 0.02em;
}

.feed-panel-close-btn {
    position: static;
}

.feed-tabs {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 8px 18px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}

.feed-tab {
    background: none;
    border: none;
    color: #888;
    font-family: 'Orbitron', sans-serif;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.04em;
    padding: 11px 16px;
    cursor: pointer;
    position: relative;
}

.feed-tab:hover {
    color: #ddd;
}

.feed-tab.active {
    color: var(--renegade-accent);
}

.feed-tab.active::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 14px;
    right: 14px;
    height: 2px;
    background-color: var(--renegade-accent);
    border-radius: 2px 2px 0 0;
}

.feed-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-bottom: 20px;
}

.feed-sentinel {
    height: 1px;
    width: 100%;
    order: 9999;
}

.feed-card {
    width: 100%;
    max-width: 560px;
    padding: 16px 4px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    box-sizing: border-box;
    animation: feedCardIn 0.3s ease both;
}

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

.feed-card-removing {
    animation: feedCardOut 0.2s ease forwards;
    overflow: hidden;
}

@keyframes feedCardOut {
    to {
        opacity: 0;
        transform: scale(0.97);
    }
}

.feed-card-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 0 12px;
}

.feed-card-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #161616;
    border: 1px solid var(--renegade-accent);
    color: var(--renegade-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 15px;
    flex-shrink: 0;
    overflow: hidden;
    cursor: pointer;
}

.feed-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.feed-card-header-text {
    flex: 1;
    min-width: 0;
}

.feed-card-author {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: inline-block;
}

.feed-card-author:hover {
    text-decoration: underline;
}

.feed-card-meta {
    color: #888;
    font-size: 11px;
    margin-top: 2px;
}

.feed-card-reason {
    color: var(--renegade-accent);
    opacity: 0.9;
}

.feed-card-menu-btn-trigger {
    background: none;
    border: none;
    color: #888;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 8px;
    flex-shrink: 0;
    border-radius: 4px;
}

.feed-card-menu-btn-trigger:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.06);
}

.feed-card-body {
    cursor: pointer;
    margin-top: 8px;
}

.feed-card-caption {
    color: #eaeaea;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    padding: 0 12px 10px;
    white-space: pre-wrap;
    word-break: break-word;
}

.feed-card-media {
    display: block;
    width: 100%;
    max-height: 65vh;
    object-fit: contain;
    background-color: #000;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.feed-card-footer {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 10px 8px 0;
}

.feed-card-action-btn {
    background: none;
    border: none;
    color: #999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    padding: 7px 12px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.feed-card-action-btn:hover {
    background-color: rgba(255, 255, 255, 0.07);
    color: #fff;
}

.feed-card-like-btn.liked {
    color: #ff4d6d;
}

.feed-card-menu {
    position: fixed;
    display: flex;
    flex-direction: column;
    min-width: 170px;
    padding: 4px;
    background-color: #111111;
    border: 1px solid var(--renegade-accent);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    z-index: 20000;
}

.feed-card-menu-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    padding: 9px 12px;
    font-size: 13px;
    border-radius: 5px;
    cursor: pointer;
    margin: 1px 0;
}

.feed-skeleton {
    width: 100%;
    max-width: 560px;
}

.feed-skeleton-card {
    padding: 16px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.feed-skeleton-header {
    display: flex;
    gap: 10px;
    align-items: center;
}

.feed-skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    background: linear-gradient(90deg, #161616 25%, #232323 37%, #161616 63%);
    background-size: 400% 100%;
    animation: feedShimmer 1.4s ease infinite;
}

.feed-skeleton-lines {
    flex: 1;
}

.feed-skeleton-line {
    height: 9px;
    border-radius: 4px;
    background: linear-gradient(90deg, #161616 25%, #232323 37%, #161616 63%);
    background-size: 400% 100%;
    animation: feedShimmer 1.4s ease infinite;
    margin-bottom: 6px;
}

.feed-skeleton-line.short {
    width: 40%;
}

.feed-skeleton-line.shorter {
    width: 25%;
}

.feed-skeleton-media {
    height: 220px;
    margin-top: 12px;
    border-radius: 6px;
    background: linear-gradient(90deg, #161616 25%, #232323 37%, #161616 63%);
    background-size: 400% 100%;
    animation: feedShimmer 1.4s ease infinite;
}

@keyframes feedShimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: 0 0;
    }
}

.feed-empty-state {
    width: 100%;
    max-width: 380px;
    text-align: center;
    padding: 70px 20px;
    color: #888;
}

.feed-empty-state-heading {
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.feed-empty-state-body {
    font-size: 13px;
    line-height: 1.5;
}

.feed-retry-btn {
    margin-top: 16px;
    padding: 9px 20px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
}



.friend-chat-attach-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    bottom: 52px;
    left: 0;
    min-width: 170px;
    background-color: #141414;
    border: 1px solid var(--renegade-accent);
    border-radius: 10px;
    padding: 6px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.6);
    z-index: 30;
}

.friend-chat-attach-menu.open {
    display: flex;
}

.friend-chat-attach-menu-btn {
    background: none;
    border: none;
    color: var(--renegade-accent);
    text-align: left;
    padding: 10px 12px;
    font-size: 14px;
    border-radius: 6px;
    cursor: pointer;
}

.friend-chat-attach-menu-btn:hover {
    background-color: #222222;
}

.friend-chat-input-row {
    position: relative;
}



.chat-camera-panel {
    width: 380px;
    max-width: 92vw;
    flex-direction: column;
    padding: 14px;
}


.chat-camera-panel.open {
    display: flex !important;
}

.chat-camera-stage {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 4;
    background-color: #000000;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
}

.chat-camera-video,
.chat-camera-review-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chat-camera-flip-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.55);
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    font-size: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.chat-camera-flip-btn:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.chat-camera-filter-strip {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 10px 2px 0;
}

.chat-camera-filter-btn {
    flex-shrink: 0;
    background-color: #1F1F1F;
    color: #ccc;
    border: 1px solid #333;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    cursor: pointer;
}

.chat-camera-filter-btn:hover {
    background-color: #262626;
}

.chat-camera-filter-btn.active {
    border-color: var(--renegade-accent);
    color: var(--renegade-accent);
    font-weight: bold;
}

.chat-camera-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 14px;
}

.chat-camera-shutter-btn {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 4px solid var(--renegade-accent);
    cursor: pointer;
    padding: 0;
}

.chat-camera-shutter-btn:hover {
    opacity: 0.9;
}

.chat-camera-retake-btn,
.chat-camera-send-btn {
    background-color: #1F1F1F;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14px;
    cursor: pointer;
}

.chat-camera-send-btn {
    background-color: var(--renegade-accent);
    color: #000000;
    font-weight: bold;
}

.chat-camera-retake-btn:hover {
    background-color: #2a2a2a;
}

.chat-camera-send-btn:hover {
    opacity: 0.9;
}

.chat-camera-send-btn:disabled,
.chat-camera-retake-btn:disabled {
    opacity: 0.5;
    cursor: default;
}


/* Forced-colors (Windows contrast themes): opt every element out so the
   selected theme's text and border colors are always used. */
html, html * {
    forced-color-adjust: none;
}

/* ---------------------------------------------------------------
   Projects panel (multi-project, folders, AI builds) - project.js
   --------------------------------------------------------------- */
.project-panel {
    width: 600px;
    max-width: 94vw;
    max-height: 90vh;
    overflow-y: auto;
}

.project-panel.project-panel-dragover {
    box-shadow: 0 0 0 2px var(--renegade-accent), 0 0 24px rgba(var(--renegade-accent-rgb), 0.5);
}

.project-panel-toolbar {
    flex-wrap: wrap;
}

.project-picker-row .project-picker {
    flex: 2 1 180px;
    min-width: 0;
    background-color: #111111;
    color: var(--renegade-accent);
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 13px;
}

.project-picker-row .account-panel-button {
    flex: 1 1 auto;
}

.project-panel-small-row {
    justify-content: center;
    gap: 14px;
    margin-top: -4px;
}

.project-link-btn {
    background: none;
    border: none;
    color: var(--renegade-accent);
    font-size: 11px;
    cursor: pointer;
    padding: 2px 4px;
    text-decoration: underline;
    opacity: 0.8;
}

.project-link-btn:hover {
    opacity: 1;
}

.project-link-btn-danger {
    color: #ff6b6b;
}

.project-panel-status {
    color: var(--renegade-accent);
    font-size: 12px;
    text-align: center;
    min-height: 16px;
    margin-bottom: 8px;
    word-break: break-word;
}

.project-panel-status-bad {
    color: #ff6b6b;
}

.project-folder-row {
    background-color: #0a0a0a;
}

.project-ai-box,
.project-ai-preview {
    margin-bottom: 10px;
}

.project-ai-stream {
    max-height: 140px;
    overflow: auto;
    background-color: #0a0a0a;
    color: var(--renegade-code-color);
    border: 1px solid #333;
    border-radius: 6px;
    padding: 8px;
    font-size: 11px;
    white-space: pre-wrap;
    word-break: break-word;
}

.project-ai-summary {
    color: #ddd;
    font-size: 12px;
    margin-bottom: 8px;
    white-space: pre-wrap;
}

.project-ai-change {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    border: 1px solid #333;
    border-radius: 6px;
    padding: 6px 8px;
    margin-bottom: 6px;
    background-color: #111111;
}

.project-ai-change-label {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.project-ai-path {
    color: var(--renegade-accent);
    font-size: 12px;
    font-weight: bold;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.project-ai-tag {
    font-size: 10px;
    text-transform: uppercase;
    border-radius: 4px;
    padding: 1px 5px;
    border: 1px solid currentColor;
}

.project-ai-tag-new { color: #7cfc7c; }
.project-ai-tag-changed { color: var(--renegade-accent); }
.project-ai-tag-delete { color: #ff6b6b; }

.project-ai-file-preview {
    flex-basis: 100%;
    max-height: 260px;
    overflow: auto;
    background-color: #0a0a0a;
    color: var(--renegade-code-color);
    border: 1px solid #333;
    border-radius: 6px;
    padding: 8px;
    font-size: 11px;
    white-space: pre;
    margin: 4px 0 0;
}

.project-editor-image {
    display: block;
    max-width: 100%;
    max-height: 60vh;
    margin: 0 auto 10px;
    border: 1px solid #333;
    border-radius: 6px;
    background: repeating-conic-gradient(#222 0% 25%, #111 0% 50%) 50% / 16px 16px;
}

.project-picker-row .project-picker {
    flex: 1 1 100%;
}

.project-picker-row .account-panel-button,
.project-panel-toolbar .account-panel-button {
    width: auto;
    flex: 1 1 40%;
}

.project-panel .project-link-btn {
    width: auto !important;
    height: auto !important;
    border: none !important;
    background: none !important;
    box-shadow: none !important;
}

/* Main chat: "saved files to project" notice under a reply */
.chat-project-save-notice {
    margin-top: 8px;
    padding: 6px 10px;
    border: 1px solid var(--renegade-accent);
    border-radius: 6px;
    color: var(--renegade-accent);
    font-size: 12px;
    background-color: rgba(var(--renegade-accent-rgb), 0.08);
}

.chat-project-save-notice-bad {
    color: #ff6b6b;
    border-color: #663333;
}

.chat-project-save-notice .chat-project-open-btn {
    margin-left: 6px;
    padding: 3px 10px;
    font-size: 12px;
    border-radius: 5px;
    width: auto;
}

/* Projects opens on top of the Coding panel (which stays open underneath). */
#project-panel.project-panel,
#project-editor-panel.project-editor-panel {
    z-index: 10002;
}

/* Conversations panel: "Saved to your account" (script.js refreshAccountChats) */
.account-chats-title {
    color: var(--renegade-accent);
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    border-top: 1px solid #333;
    padding-top: 10px;
    margin: 10px 0 4px;
}

.account-chats-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 40vh;
    overflow-y: auto;
    margin-bottom: 10px;
}

.account-chat-row {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #444;
    border-radius: 6px;
    padding: 6px 8px;
    background-color: #111111;
}

.account-chat-meta {
    flex: 1;
    min-width: 0;
    cursor: pointer;
}

.account-chat-name {
    color: var(--renegade-accent);
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.account-chat-detail {
    color: #999;
    font-size: 11px;
    margin-top: 2px;
}

.account-chat-delete {
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    border-radius: 5px;
    cursor: pointer;
}

.account-chats-empty {
    color: #999;
    font-size: 12px;
    text-align: center;
    padding: 8px 0;
}

/* Settings + Account panels on computers (web and Windows app): no "Close" button at
   the bottom - the same button becomes a small red ✕ in the top-right corner, like
   the profile panels. Phones keep their own layout from mobile.css (max-width 499px). */
@media (min-width: 500px) {
    #settings-panel > .renegade-modal-close-button,
    #account-panel > .renegade-modal-close-button {
        position: absolute !important;
        top: 10px !important;
        right: 12px !important;
        width: 26px !important;
        height: 26px !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        background: none !important;
        border: none !important;
        border-radius: 50% !important;
        box-shadow: none !important;
        font-size: 0 !important;
        line-height: 1 !important;
        color: #ff3b3b !important;
        opacity: 0.85;
        cursor: pointer;
        z-index: 2;
    }

    #settings-panel > .renegade-modal-close-button::before,
    #account-panel > .renegade-modal-close-button::before {
        content: "✕";
        font-size: 15px;
        color: #ff3b3b;
    }

    #settings-panel > .renegade-modal-close-button:hover,
    #account-panel > .renegade-modal-close-button:hover {
        opacity: 1;
        background: rgba(255, 59, 59, 0.12) !important;
    }

    #settings-panel > .renegade-modal-title,
    #account-panel > .renegade-modal-title {
        padding-left: 30px;
        padding-right: 30px;
    }
}

/* ===== Call buttons (2026-10-01) =====
   In-call buttons were squeezed by the flex row (8 of them in a phone-wide or small floating
   window), so their width shrank below their height and the 50% radius drew ovals.
   They now never shrink and always stay 1:1; the row wraps instead when there isn't room. */
.rc-actions {
    flex-wrap: wrap;
    row-gap: 10px;
}

.rc-btn {
    flex: 0 0 auto !important;
    aspect-ratio: 1 / 1;
    min-width: 36px;
    min-height: 36px;
    box-sizing: border-box;
    border-radius: 50% !important;
    -webkit-tap-highlight-color: transparent;
}

.rc-btn-accept,
.rc-btn-hangup {
    min-width: 44px;
    min-height: 44px;
}

@media (max-width: 499px) {
    .rc-actions {
        gap: 8px;
        padding-left: 6px;
        padding-right: 6px;
    }
}

/* Chat titlebar voice / video call buttons: circular, and no grey square left behind after a
   tap on phones (touch screens keep :hover "stuck" after tapping, and WebViews flash a grey
   tap highlight). The video button's 🎥 is drawn with the color emoji font so it keeps the
   phone's own emoji colors instead of a flat grey text-style glyph. */
#friend-chat-call-btn,
#friend-chat-video-btn,
.group-chat-call-btn,
.group-chat-video-btn {
    border-radius: 50% !important;
    -webkit-tap-highlight-color: transparent;
}

#friend-chat-video-btn,
.group-chat-video-btn {
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif !important;
    color: initial !important;
    font-size: 17px;
    filter: none !important;
    opacity: 1 !important;
}

@media (hover: none) {
    #friend-chat-call-btn:hover,
    #friend-chat-video-btn:hover,
    .group-chat-call-btn:hover,
    .group-chat-video-btn:hover,
    .friend-chat-action-btn:hover {
        background-color: transparent !important;
    }
}

/* ===================== Coding panel redesign (Oct 3 2026): 📂 Files on the left, chat with its own
   input bar at the bottom (same look as the AI chat), no editor column, Scan History opens inside. */
.coding-nav {
    flex: 0 0 230px;
}

.coding-chat-content {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.coding-view {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.coding-view .coding-chat-log {
    margin-top: 0;
}

.coding-files {
    margin-top: 6px;
    padding-top: 10px;
    border-top: 1px solid #333;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 0;
    flex: 1 1 auto;
}

.coding-files-head {
    color: var(--renegade-accent);
    font-weight: bold;
    font-size: 13px;
}

.coding-files-project {
    width: 100%;
    background: #000;
    color: var(--renegade-accent);
    border: 1px solid #444;
    border-radius: 6px;
    padding: 5px 6px;
    font-size: 12px;
}

.coding-files-btns {
    display: flex;
    gap: 4px;
}

.coding-files .coding-files-btn {
    flex: 1 1 auto;
    width: auto;
    margin: 0;
    padding: 4px 6px;
    font-size: 11px;
    border-radius: 6px;
}

.coding-files-note {
    color: #888;
    font-size: 11px;
    line-height: 1.35;
}

.coding-files-list {
    flex: 1 1 auto;
    min-height: 80px;
    overflow-y: auto;
    border: 1px solid #262626;
    border-radius: 6px;
    padding: 4px;
    background: #050505;
}

.coding-files-folder {
    color: #9a9a9a;
    font-size: 11px;
    margin: 6px 2px 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.coding-file-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 3px 4px;
    border-radius: 4px;
    font-size: 12px;
    color: #ccc;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
}

.coding-file-row.nested {
    padding-left: 14px;
}

.coding-file-row span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.coding-file-row:hover {
    background: #151515;
}

.coding-file-row.on {
    background: rgba(var(--renegade-accent-rgb), 0.14);
    color: var(--renegade-accent);
}

.coding-file-row input {
    margin: 0;
    flex-shrink: 0;
    accent-color: var(--renegade-accent);
}

.coding-selected-files {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
    margin-top: 6px;
    font-size: 11px;
}

.coding-chip-label {
    color: #888;
}

.coding-chip {
    border: 1px solid var(--renegade-accent);
    color: var(--renegade-accent);
    border-radius: 12px;
    padding: 1px 8px;
    cursor: pointer;
}

.coding-chip::after {
    content: " ✕";
    opacity: 0.6;
}

.coding-msg-files {
    font-size: 11px;
    color: #888;
    margin-top: 3px;
}

.coding-input-bar {
    display: flex;
    gap: 10px;
    width: 100%;
    min-height: 30px;
    margin-top: 8px;
    align-items: flex-end;
    box-sizing: border-box;
    flex-shrink: 0;
}

#coding-undo-btn {
    width: 110px !important;
    height: 30px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    flex-shrink: 0;
    border-radius: 10px;
}

#coding-chat-input {
    flex: 1 1 auto;
    min-width: 0;
    width: 0;
    height: 30px;
    max-height: 160px;
    min-height: 30px;
    background: #000;
    border: 1px solid var(--renegade-accent);
    color: var(--renegade-accent);
    padding: 6px 8px;
    border-radius: 10px;
    outline: none;
    box-sizing: border-box;
    resize: none;
    overflow-y: auto;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.3;
    white-space: pre-wrap;
    margin: 0;
}

#coding-chat-input:focus {
    box-shadow: 0 0 8px rgba(var(--renegade-accent-rgb), 0.35);
}

#coding-chat-input::placeholder {
    color: rgba(var(--renegade-accent-rgb), 0.55);
}

#coding-chat-send-btn,
#coding-chat-stop-btn {
    height: 30px;
    border-radius: 10px;
    flex-shrink: 0;
    width: auto;
    margin: 0;
    padding: 0 14px;
}

#coding-chat-stop-btn:hover {
    background: var(--renegade-accent);
    color: #000;
}

.coding-side-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    flex-shrink: 0;
}

.coding-side-bar .coding-files-btn {
    width: auto;
    margin: 0;
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.coding-side-title {
    color: var(--renegade-accent);
    font-weight: bold;
}

.coding-side-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.coding-side-body .scan-history-list {
    max-height: none;
}

/* Coding panel (Oct 3, later): "Working on project ..." centred in the title row; ↩ Undo in the input bar. */
#coding-panel .renegade-modal-title.coding-title-row {
    position: relative;
    text-align: left;
}

.coding-title-hint {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    max-width: 62%;
    font-size: 12px;
    font-weight: normal;
    color: #aaa;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

#coding-undo-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
