body {
    margin: 0;
    font-family: 'Fira Code', monospace;
    background-color: #1e1e1e;
    color: #e0e0e0;
}

.playground-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

@media (min-width: 768px) {
    .playground-container {
        flex-direction: row;
    }
}

.editor-section,
.output-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0.75rem;
    min-height: 50vh;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
}

h1 {
    font-size: 1.75rem;
    margin: 0 0 1rem;
    background: linear-gradient(90deg, #a78bfa, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.site-logo {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.site-logo h1 {
    margin: 0;
    transition: opacity 0.15s;
}

.site-logo:hover h1 { opacity: 0.8; }

h2 {
    font-size: 1.5rem;
    color: #c4b5fd;
    margin-bottom: 1rem;
}

.editor-box,
#editor {
    flex-grow: 1;
    min-height: 250px;
    max-height: 45vh;
    background-color: #1e1e1e;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 0 0 8px 8px;
    border-top: none;
    overflow: auto;
}

@media (min-width: 768px) {
    .editor-box,
    #editor {
        max-height: unset;
    }
}

.run-btn,
button.btn {
    margin-top: 0.5rem;
    background: linear-gradient(135deg, #1db954 0%, #17a349 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    cursor: pointer;
    width: 100%;
    z-index: 10;
    box-sizing: border-box;
    box-shadow: 0 2px 10px rgba(29, 185, 84, 0.25);
    transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.run-btn:hover,
button.btn:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 16px rgba(29, 185, 84, 0.4);
    transform: translateY(-1px);
}

.run-btn:active,
button.btn:active {
    transform: translateY(0px);
    box-shadow: 0 1px 6px rgba(29, 185, 84, 0.25);
    filter: brightness(0.95);
}

.output-section {
    background-color: #0f0f18;
    border-top: 1px solid rgba(255,255,255,0.06);
}

@media (min-width: 768px) {
    .output-section {
        border-left: 1px solid rgba(255,255,255,0.06);
        border-top: none;
    }
}

.output-box,
pre {
    flex: 1;
    background-color: #0f0f18;
    color: #c8d8c8;
    padding: 0.85rem 1rem;
    margin-top: 0.2rem;
    border-radius: 8px;
    overflow-y: auto;
    white-space: pre;
    word-wrap: normal;
    font-size: 0.875rem;
    line-height: 1.55;
}

.output-running {
    color: #888;
    animation: pulse 1.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.validation-message,
.invalid {
    color: #ff6b6b;
}

.valid.modified:not([type=checkbox]) {
    border: 1px solid #26b050;
}
.editor-box {
    width: 100%;
    height: 400px;
    border: 1px solid rgba(255,255,255,0.08);
    position: relative;
    overflow: visible;
}

.editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #6d28d9;
    color: #fff;
    border: none;
    padding: 0.38rem 0.85rem;
    border-radius: 6px;
    font-size: 0.84rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
    transition: background 0.15s;
}

.share-btn:hover {
    background: #7c3aed;
}

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

.output-tabs {
    display: flex;
    gap: 0.25rem;
    padding: 0.5rem 0 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    margin-bottom: 0;
}

.tab-btn {
    background: transparent;
    color: #888;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.35rem 0.9rem;
    font-size: 0.85rem;
    font-family: 'Fira Code', monospace;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    width: auto;
    margin-top: 0;
}

.tab-btn:hover {
    color: #e0e0e0;
}

.tab-btn.active {
    color: #a78bfa;
    border-bottom: 2px solid #a78bfa;
}

.decompile-box {
    font-size: 0.78rem;
    color: #c5c8c6;
}
.mode-select {
    background: rgba(255,255,255,0.03);
    color: #c0c0d8;
    border: 1px solid rgba(255,255,255,0.09);
    border-radius: 6px;
    padding: 0.38rem 1.7rem 0.38rem 0.7rem;
    font-size: 0.84rem;
    font-family: 'Fira Code', monospace;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.55rem center;
    transition: border-color 0.15s, color 0.15s;
    line-height: 1;
}

.mode-select:hover {
    border-color: rgba(255,255,255,0.2);
    color: #e0e0f0;
}

/* ─── Toolbar button system ─────────────────────────────── */
.tb-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.38rem 0.7rem;
    border-radius: 6px;
    font-size: 0.84rem;
    font-family: 'Fira Code', monospace;
    font-weight: normal;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: #8888aa;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
    line-height: 1;
}
.tb-btn:hover {
    background: rgba(255,255,255,0.07);
    color: #d0d0f0;
    border-color: rgba(255,255,255,0.15);
}
.tb-btn:disabled { opacity: 0.45; cursor: default; }
.tb-btn--active {
    background: rgba(124,58,237,0.15);
    color: #a78bfa;
    border-color: rgba(124,58,237,0.3);
}
.tb-btn--vis {
    padding: 0.38rem 0.55rem;
    color: #6060a0;
}
.tb-btn--vis:hover { color: #a0a0d0; }

.toolbar-sep {
    width: 1px;
    height: 18px;
    background: rgba(255,255,255,0.07);
    flex-shrink: 0;
    align-self: center;
}

.share-url-box {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.share-url-box input {
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    cursor: pointer;
}

.copy-btn {
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #555;
    border-radius: 4px;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
}

.share-error {
    color: #f48771;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.file-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    background: #1a1a28;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    padding: 0 0.4rem;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: thin;
    margin-top: 0.5rem;
    border-radius: 6px 6px 0 0;
}

.file-tab {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    background: #21212e;
    color: #7070a0;
    border: 1px solid transparent;
    border-bottom: none;
    border-radius: 3px 3px 0 0;
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.file-tab:hover {
    background: #2a2a3a;
    color: #c0c0e0;
}

.file-tab.active {
    background: #1e1e1e;
    color: #e0e0ff;
    border-color: rgba(255,255,255,0.08);
}

.file-tab-close {
    font-size: 0.9rem;
    line-height: 1;
    padding: 0 2px;
    border-radius: 2px;
    color: #888;
}

.file-tab-close:hover {
    background: #ff5555;
    color: #fff;
}

.file-tab-add {
    background: transparent;
    color: #888;
    border: none;
    font-size: 1rem;
    padding: 0.3rem 0.6rem;
    cursor: pointer;
    border-radius: 3px;
    font-family: inherit;
}

.file-tab-add:hover {
    background: #3c3c3c;
    color: #a78bfa;
}

.file-tab-rename-wrapper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #7c3aed;
    border-radius: 3px;
    background: #1e1e1e;
}

.file-tab-rename-input {
    background: transparent;
    color: #ffffff;
    border: none;
    padding: 0.25rem 0.25rem 0.25rem 0.5rem;
    font-size: 0.8rem;
    font-family: inherit;
    outline: none;
    width: 90px;
}

.file-tab-rename-suffix {
    color: #888;
    font-size: 0.8rem;
    font-family: inherit;
    padding-right: 0.4rem;
    user-select: none;
    pointer-events: none;
}

.decompile-notice {
    margin-left: auto;
    font-size: 0.75rem;
    color: #666;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding-right: 0.25rem;
    white-space: nowrap;
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #7c3aed;
    object-fit: cover;
}

.user-avatar-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #3a2a5e;
    color: #a78bfa;
    font-size: 1rem;
}

.user-login {
    font-size: 0.85rem;
    color: #c4b5fd;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.auth-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: background 0.15s, color 0.15s;
}

.login-btn {
    background: #7c3aed;
    color: #fff;
}

.login-btn:hover {
    background: #6d28d9;
    color: #fff;
}

.snippets-btn, .logout-btn {
    background: #2a2a2a;
    color: #a78bfa;
    border: 1px solid #3a3a3a;
    font-family: inherit;
    font-size: 0.85rem;
    line-height: 1;
}

.snippets-btn:hover, .logout-btn:hover {
    background: #3c3c3c;
    color: #c4b5fd;
}

.my-snippets-panel {
    background: #1e1e1e;
    border: 1px solid #333;
    border-radius: 8px;
    overflow: hidden;
    position: absolute;
    top: 4rem;
    left: 1rem;
    right: 1rem;
    z-index: 50;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.my-snippets-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0.85rem;
    background: #252526;
    border-bottom: 1px solid #333;
    color: #cccccc;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.my-snippets-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 1rem;
    padding: 0.1rem 0.3rem;
    border-radius: 4px;
    line-height: 1;
    width: auto;
    transition: background 0.12s, color 0.12s;
}

.my-snippets-close:hover { color: #ccc; background: #333; }

.my-snippets-loading, .my-snippets-empty {
    padding: 1.4rem 1rem;
    color: #555;
    font-size: 0.82rem;
    margin: 0;
    text-align: center;
}

.my-snippets-list {
    list-style: none;
    margin: 0;
    padding: 0.3rem;
    max-height: 240px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #444 transparent;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.my-snippets-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.1s;
}

.my-snippets-item:hover {
    background: #2a2d2e;
}

.my-snippets-item-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.my-snippets-preview {
    font-size: 0.78rem;
    color: #d4d4d4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Fira Code', monospace;
}

.my-snippets-date {
    font-size: 0.68rem;
    color: #5a5a5a;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.my-snippets-delete {
    background: none;
    border: none;
    color: #555;
    cursor: pointer;
    padding: 0.25rem 0.4rem;
    border-radius: 4px;
    font-size: 0.8rem;
    line-height: 1;
    width: auto;
    flex-shrink: 0;
    transition: background 0.12s, color 0.12s;
}

.my-snippets-delete:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #e06c75;
}

.user-avatar-wrap {
    position: relative;
    display: inline-flex;
    flex-shrink: 0;
}

.user-online-dot {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 9px;
    height: 9px;
    background: #1db954;
    border-radius: 50%;
    border: 2px solid #1e1e1e;
}

.signin-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: overlayIn 0.12s ease;
}

@keyframes overlayIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.signin-modal {
    background: #18181f;
    border: 1px solid #2a2a3a;
    border-top: 3px solid #7c3aed;
    border-radius: 8px;
    padding: 1.5rem 1.75rem;
    max-width: 360px;
    width: 90%;
    animation: modalIn 0.15s ease;
}

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

.signin-modal-title {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.85rem;
    font-size: 1rem;
    font-weight: 600;
    color: #e0e0e0;
}

.signin-modal-title i.bi-github {
    font-size: 1.1rem;
    color: #a78bfa;
}

.signin-modal-title span {
    flex: 1;
}

.signin-modal-close {
    background: none;
    border: none;
    color: #555;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.2rem 0.3rem;
    border-radius: 4px;
    width: auto;
    margin: 0;
    line-height: 1;
    flex-shrink: 0;
}

.signin-modal-close:hover { color: #aaa; background: #2a2a2a; }

.signin-modal p {
    color: #777;
    font-size: 0.83rem;
    margin: 0 0 1.25rem;
    line-height: 1.55;
    border-bottom: 1px solid #222230;
    padding-bottom: 1.1rem;
}

.signin-modal-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.signin-modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    background: #24292e;
    color: #fff;
    border: 1px solid #444;
    padding: 0.55rem 1.1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s;
}

.signin-modal-btn:hover {
    background: #2f363d;
    border-color: #666;
    color: #fff;
}

.signin-modal-cancel {
    background: none;
    border: none;
    color: #555;
    font-size: 0.83rem;
    cursor: pointer;
    padding: 0;
    width: auto;
    margin: 0;
    transition: color 0.12s;
}

.signin-modal-cancel:hover { color: #999; }

.mobile-menu-btn,
.mobile-bottom-nav,
.mobile-fab-run,
.mobile-sheet-overlay {
    display: none;
}

@media (max-width: 767px) {

    .playground-container.mobile-show-editor .output-section {
        display: none;
    }

    .playground-container.mobile-show-output .editor-section {
        display: none;
    }

    .editor-section,
    .output-section {
        height: calc(100vh - 56px);
        min-height: unset;
        overflow-y: auto;
        padding: 0.75rem;
    }

    .editor-box,
    #editor {
        max-height: unset;
        flex: 1;
        min-height: 200px;
    }

    .header-actions {
        display: none;
    }

    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: #2a2a2a;
        color: #a78bfa;
        border: 1px solid #3a3a3a;
        border-radius: 6px;
        padding: 0.45rem 0.7rem;
        font-size: 1.1rem;
        cursor: pointer;
        flex-shrink: 0;
        margin: 0;
        width: auto;
    }

    .mobile-menu-btn:active {
        background: #3a3a3a;
    }

    h1 {
        font-size: 1.4rem;
        margin: 0;
    }

    .run-btn {
        display: none;
    }

    .mobile-fab-edit {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: calc(56px + 14px);
        left: 16px;
        width: 48px;
        height: 48px;
        border-radius: 50%;
        background: #2e2e2e;
        color: #c9d1d9;
        border: 1px solid #444;
        font-size: 1.2rem;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
        z-index: 100;
        transition: background 0.2s;
    }

    .mobile-fab-edit:active {
        background: #3a3a3a;
    }

    .mobile-fab-run {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        bottom: calc(56px + 14px);
        right: 16px;
        width: 58px;
        height: 58px;
        border-radius: 50%;
        background: linear-gradient(135deg, #1db954 0%, #17a349 100%);
        color: white;
        border: none;
        font-size: 1.5rem;
        cursor: pointer;
        box-shadow: 0 4px 18px rgba(29, 185, 84, 0.55);
        z-index: 100;
        transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.2s;
        margin: 0;
        padding: 0;
        width: 58px;
    }

    .mobile-fab-run:active {
        transform: scale(0.9);
        box-shadow: 0 2px 8px rgba(29, 185, 84, 0.3);
    }

    .mobile-fab-run.running {
        background: linear-gradient(135deg, #555 0%, #3a3a3a 100%);
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
        animation: fabPulse 1s ease infinite;
    }

    .mobile-fab-run:disabled {
        cursor: default;
    }

    @keyframes fabPulse {
        0%, 100% { opacity: 1; }
        50%       { opacity: 0.65; }
    }

    .mobile-bottom-nav {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        height: 56px;
        background: #1a1a1a;
        border-top: 1px solid #2e2e2e;
        z-index: 99;
    }

    .mobile-nav-btn {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        background: none;
        border: none;
        color: #555;
        font-size: 0.62rem;
        font-family: 'Fira Code', monospace;
        letter-spacing: 0.03em;
        cursor: pointer;
        padding: 0;
        margin: 0;
        width: auto;
        transition: color 0.15s;
    }

    .mobile-nav-btn i {
        font-size: 1.25rem;
    }

    .mobile-nav-btn.active {
        color: #a78bfa;
    }

    .mobile-nav-btn:active {
        color: #c4b5fd;
    }

    .file-tab {
        padding: 0.55rem 1rem;
        font-size: 0.82rem;
    }

    .file-tab-close {
        padding: 2px 6px;
        font-size: 1rem;
    }

    .file-tab-add {
        padding: 0.4rem 0.75rem;
        font-size: 1rem;
    }

    .tab-btn {
        padding: 0.55rem 1.1rem;
        font-size: 0.88rem;
    }

    .output-section {
        border-top: none;
    }

    .my-snippets-list {
        max-height: 200px;
    }
}

@media (max-width: 767px) {
    .mobile-sheet-overlay {
        display: flex;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        align-items: flex-end;
        z-index: 200;
        animation: overlayIn 0.15s ease;
    }

    .mobile-sheet {
        width: 100%;
        background: #18181f;
        border: 1px solid #2a2a3a;
        border-top: 3px solid #7c3aed;
        border-radius: 18px 18px 0 0;
        padding: 0.25rem 1.1rem 2.5rem;
        box-sizing: border-box;
        animation: sheetUp 0.2s ease;
    }

    .mobile-sheet-handle {
        width: 38px;
        height: 4px;
        background: #3a3a4a;
        border-radius: 2px;
        margin: 0.6rem auto 1.1rem;
    }

    .mobile-sheet-row {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        padding: 0.75rem 0;
        border-bottom: 1px solid #22222e;
    }

    .mobile-sheet-row:last-child {
        border-bottom: none;
    }

    .mobile-sheet-label {
        font-size: 0.82rem;
        color: #666;
        white-space: nowrap;
        display: flex;
        align-items: center;
        gap: 0.35rem;
    }

    .mobile-sheet-auth {
        padding-top: 0.85rem;
        padding-bottom: 0.85rem;
    }
}

@keyframes sheetUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

.session-page {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background: #0d0d0d;
    color: #d4d4d4;
    font-family: 'Segoe UI', system-ui, sans-serif;
    padding: 1rem 1.5rem;
    box-sizing: border-box;
}

.session-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.session-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #a855f7;
    text-decoration: none;
}
.session-brand:hover { opacity: 0.8; }

.session-link-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: #1a1a2e;
    border: 1px solid #3c3c6e;
    border-radius: 8px;
    padding: 0.35rem 0.75rem;
    font-size: 0.82rem;
    color: #a0a0c8;
    flex: 1;
    min-width: 0;
    max-width: 480px;
}
.session-link-row span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}
.session-link-copy {
    background: none;
    border: none;
    color: #a855f7;
    cursor: pointer;
    padding: 0;
    font-size: 1rem;
    flex-shrink: 0;
    line-height: 1;
}
.session-link-copy:hover { color: #c084fc; }

.participants-strip {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.participant-avatar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: #1a1a2e;
    border-radius: 20px;
    padding: 0.2rem 0.6rem 0.2rem 0.2rem;
    font-size: 0.78rem;
    color: #ccc;
    border: 1px solid #2d2d4a;
}

.participant-avatar img {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
}

.participant-avatar .color-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.session-editor-area {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    gap: 0;
    margin-top: 0.75rem;
}

.session-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
}

.session-run-btn {
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 0.4rem 1rem;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    transition: opacity 0.15s;
}
.session-run-btn:hover { opacity: 0.88; }
.session-run-btn:disabled { opacity: 0.5; cursor: default; }

.session-add-file-btn {
    background: #1e1e2e;
    border: 1px dashed #555;
    color: #888;
    border-radius: 6px;
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}
.session-add-file-btn:hover { color: #a855f7; border-color: #a855f7; }

#session-editor {
    flex-grow: 1;
    min-height: 300px;
    max-height: 48vh;
    background-color: #1e1e1e;
    border: 1px solid #444;
    border-radius: 0 0 8px 8px;
    border-top: none;
}

.session-output-section {
    margin-top: 1.25rem;
}

.session-not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    gap: 1rem;
    color: #888;
}
.session-not-found h2 { color: #e05c5c; margin: 0; }
.session-not-found a { color: #a855f7; text-decoration: none; }
.session-not-found a:hover { text-decoration: underline; }

/* .start-session-btn → now uses .tb-btn */

/* legacy nuget-btn → now tb-btn */

.package-panel {
    background: #1e1e1e;
    border-bottom: 1px solid #3e3e42;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
}
.package-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}
.panel-title { font-weight: 600; color: #cccccc; font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; }
.close-btn {
    background: none;
    border: none;
    color: #858585;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 0.25rem;
}
.close-btn:hover { color: #cccccc; }
.search-row { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.search-input {
    flex: 1;
    background: #2d2d2d;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #d4d4d4;
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
}
.search-input:focus { outline: none; border-color: #007acc; }
.search-results {
    list-style: none;
    margin: 0 0 0.5rem;
    padding: 0;
    max-height: 180px;
    overflow-y: auto;
    background: #252526;
    border: 1px solid #3e3e42;
    border-radius: 4px;
}
.result-item {
    padding: 0.4rem 0.65rem;
    cursor: pointer;
    border-bottom: 1px solid #3e3e42;
}
.result-item:last-child { border-bottom: none; }
.result-item:hover, .result-item.active { background: #2a2d2e; }
.pkg-name { font-weight: 600; color: #d4d4d4; }
.pkg-desc { color: #858585; font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.version-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.version-label { color: #d4d4d4; font-weight: 600; }
.version-select {
    background: #2d2d2d;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    color: #d4d4d4;
    padding: 0.25rem 0.5rem;
    font-size: 0.82rem;
}
.add-btn {
    background: #0e639c;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    padding: 0.3rem 0.75rem;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
}
.add-btn:hover { background: #1177bb; }
.add-btn:disabled { opacity: 0.4; cursor: default; }
.added-list { list-style: none; margin: 0.25rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.added-item {
    background: #2d2d2d;
    border: 1px solid #3e3e42;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    color: #d4d4d4;
    font-size: 0.82rem;
}
.added-item em { color: #858585; font-style: normal; }
.remove-btn {
    background: none;
    border: none;
    color: #858585;
    cursor: pointer;
    font-size: 0.78rem;
    padding: 0;
    line-height: 1;
}
.remove-btn:hover { color: #f87171; }
.hint { color: #858585; font-size: 0.8rem; padding: 0.25rem 0; }

.seo-footer {
    padding: 2rem;
    background-color: #161616;
    color: #6b7280;
    font-size: 0.8rem;
    border-top: 1px solid #2a2a2a;
}
.seo-footer h2 {
    font-size: 0.9rem;
    color: #9ca3af;
    margin: 0 0 0.5rem;
    font-weight: 600;
}
.seo-footer p {
    margin: 0 0 0.5rem;
    line-height: 1.6;
}
.seo-footer ul {
    margin: 0 0 1rem;
    padding-left: 1.2rem;
    line-height: 1.8;
}
.seo-author {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding-top: 0.75rem;
    border-top: 1px solid #222;
    font-size: 0.75rem;
    color: #555;
}
.seo-author-label {
    color: #444;
}
.seo-author-name {
    color: #a78bfa;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.15s;
}
.seo-author-name:hover { color: #c4b5fd; }
.seo-author-sep { color: #333; }
.seo-author-link {
    color: #555;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.15s;
}
.seo-author-link:hover { color: #9ca3af; }

.snippet-seo-preview {
    padding: 1.5rem 2rem 2rem;
    background-color: #161616;
    border-top: 1px solid #2a2a2a;
    color: #9ca3af;
}
.snippet-seo-preview h2 {
    font-size: 0.95rem;
    color: #c4b5fd;
    margin: 0 0 0.75rem;
}
.snippet-seo-preview pre {
    max-height: 18rem;
    margin: 0;
    background: #0f0f18;
    border: 1px solid rgba(255,255,255,0.08);
    color: #d1d5db;
    overflow: auto;
    white-space: pre-wrap;
}
.seo-author-kofi { color: #72500e; }
.seo-author-kofi:hover { color: #f59e0b; }

.stdin-panel {
    display: flex;
    flex-direction: column;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.stdin-toggle {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 0.75rem;
    padding: 0.35rem 1rem;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
    transition: color 0.15s;
}
.stdin-toggle:hover { color: #e0e0e0; }
.stdin-box {
    background: #1a1a2e;
    color: #e0e0e0;
    border: none;
    border-top: 1px solid #2a2a2a;
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    resize: vertical;
    min-height: 60px;
    max-height: 150px;
    outline: none;
    width: 100%;
    box-sizing: border-box;
}

.run-btn.stop-btn {
    background: #c0392b;
}
.run-btn.stop-btn:hover { background: #e74c3c; }

.wrap-btn { margin-left: auto; }
.wrap-btn.active { color: #60a5fa; }
.output-box.output-wrap { white-space: pre-wrap; word-break: break-word; }

.error-jump-link {
    cursor: pointer;
    color: #f87171;
    text-decoration: underline dotted;
}
.error-jump-link:hover { color: #fca5a5; }

.editor-settings {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.theme-select {
    background: #1e1e2e;
    border: 1px solid #3a3a4a;
    color: #9ca3af;
    font-size: 0.7rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    cursor: pointer;
    font-family: inherit;
}
.theme-select:hover { color: #e0e0e0; border-color: #555; }
.fontsize-control {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    border: 1px solid #3a3a4a;
    border-radius: 4px;
    overflow: hidden;
}
.fontsize-btn {
    background: #1e1e2e;
    border: none;
    color: #9ca3af;
    font-size: 0.75rem;
    padding: 0.2rem 0.4rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}
.fontsize-btn:hover { background: #2a2a3a; color: #e0e0e0; }
.fontsize-label {
    font-size: 0.7rem;
    color: #9ca3af;
    padding: 0 0.25rem;
    min-width: 1.4rem;
    text-align: center;
    user-select: none;
}

.snippets-search-wrap {
    padding: 0.5rem 0.5rem 0;
}

.snippets-search {
    width: 100%;
    box-sizing: border-box;
    background: #2a2a2a;
    border: 1px solid #3c3c3c;
    border-radius: 4px;
    color: #d4d4d4;
    font-size: 0.78rem;
    padding: 0.35rem 0.6rem;
    margin-bottom: 0.4rem;
    outline: none;
    font-family: inherit;
    transition: border-color 0.12s;
}
.snippets-search:focus { border-color: #569cd6; }

.not-found-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #0d0d1a;
}
.not-found-card {
    text-align: center;
    color: #e0e0e0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.not-found-icon {
    font-size: 4rem;
    color: #60a5fa;
}
.not-found-card h2 { font-size: 1.6rem; margin: 0; }
.not-found-card p { color: #9ca3af; margin: 0; }
.hidden { display: none !important; }

.embed-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    background: #1e1e2e;
    font-family: inherit;
}
.embed-editor-wrap { flex: 1; min-height: 0; }
.embed-editor { width: 100%; height: 100%; }
.embed-toolbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: #12121e;
    border-top: 1px solid #2a2a2a;
}
.embed-open-link {
    margin-left: auto;
    color: #9ca3af;
    font-size: 0.75rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}
.embed-open-link:hover { color: #e0e0e0; }
.embed-output {
    height: 160px;
    overflow-y: auto;
    background: #12121e;
    color: #e0e0e0;
    font-family: 'Fira Code', monospace;
    font-size: 0.82rem;
    padding: 0.75rem 1rem;
    margin: 0;
    border-top: 1px solid #2a2a2a;
    white-space: pre-wrap;
    word-break: break-word;
}
.embed-not-found {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    color: #9ca3af;
    font-size: 1rem;
}

.output-status-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0.2rem 0.75rem;
    font-size: 0.7rem;
    color: #505070;
    border-top: 1px solid rgba(255,255,255,0.05);
    user-select: none;
    gap: 0.3rem;
}
.output-status-bar i { font-size: 0.65rem; }
