/* SecureChat v4 — post-login interface only */

body.messenger-chat-ui {
    --sc-bg: #070a09;
    --sc-panel: #0b100e;
    --sc-panel-2: #101713;
    --sc-line: rgba(151, 255, 194, 0.11);
    --sc-line-strong: rgba(151, 255, 194, 0.22);
    --sc-green: #8affb7;
    --sc-green-strong: #26f58a;
    --sc-cyan: #79e9ff;
    --sc-gold: #ffd36b;
    --sc-red: #ff6685;
    --sc-text: #dce9e1;
    --sc-muted: #728179;
    --sc-dim: #46534c;
    background: var(--sc-bg);
}

#phase-chat.active {
    display: flex;
    flex: 1;
    min-width: 0;
    min-height: 0;
    padding: 0;
    overflow: hidden;
}

.sc-chat-app {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    color: var(--sc-text);
    background:
        radial-gradient(circle at 85% -20%, rgba(38, 245, 138, 0.055), transparent 38%),
        var(--sc-bg);
    font-family: 'Fira Code', monospace;
    overflow: hidden;
    position: relative;
}

.sc-chat-app::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 100;
    opacity: 0.16;
    background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(138, 255, 183, 0.018) 3px 4px);
}

/* Top application bar */
.sc-shellbar {
    height: 58px;
    flex: 0 0 58px;
    display: grid;
    grid-template-columns: minmax(210px, 1fr) auto minmax(320px, 1fr);
    align-items: center;
    gap: 16px;
    padding: 0 14px;
    background: rgba(8, 12, 10, 0.98);
    border-bottom: 1px solid var(--sc-line-strong);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.22);
    position: relative;
    z-index: 20;
}

.sc-shell-brand,
.sc-shell-session,
.sc-shell-tools {
    display: flex;
    align-items: center;
}

.sc-shell-brand {
    gap: 10px;
}

.sc-shell-mark {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    color: #041008;
    background: linear-gradient(135deg, var(--sc-green), var(--sc-green-strong));
    box-shadow: 0 0 18px rgba(38, 245, 138, 0.23);
    font: 900 10px/1 'Orbitron', sans-serif;
}

.sc-shell-name {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sc-shell-name strong {
    color: var(--sc-green);
    font: 700 12px/1 'Orbitron', sans-serif;
    letter-spacing: 1.4px;
}

.sc-shell-name span,
.sc-eyebrow {
    color: var(--sc-dim);
    font: 500 8px/1.2 'Fira Code', monospace;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.sc-shell-session {
    justify-content: center;
    gap: 8px;
    min-width: 0;
    color: var(--sc-muted);
    font-size: 10px;
}

.sc-status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
}

.sc-status-dot.online {
    background: var(--sc-green-strong);
    box-shadow: 0 0 9px var(--sc-green-strong);
    animation: sc-pulse 1.8s ease-in-out infinite;
}

.sc-status-dot.offline {
    background: var(--sc-red);
    box-shadow: 0 0 7px rgba(255, 102, 133, 0.45);
}

@keyframes sc-pulse {
    50% { opacity: 0.45; }
}

.sc-online-count {
    white-space: nowrap;
}

.sc-shell-divider {
    width: 1px;
    height: 14px;
    background: var(--sc-line-strong);
}

.sc-user-tag {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--sc-cyan);
    font: 600 9px/1 'Orbitron', sans-serif;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

.sc-shell-tools {
    justify-content: flex-end;
    gap: 5px;
}

.sc-icon-btn,
.sc-exit-btn {
    height: 30px;
    border-radius: 6px;
    padding: 0 10px;
    border: 1px solid var(--sc-line);
    color: var(--sc-muted);
    background: rgba(255, 255, 255, 0.018);
    font: 600 8px/1 'Orbitron', sans-serif;
    letter-spacing: 0.4px;
    cursor: pointer;
    transition: 150ms ease;
}

.sc-icon-btn:hover,
.sc-icon-btn.active {
    color: var(--sc-green);
    border-color: var(--sc-line-strong);
    background: rgba(138, 255, 183, 0.07);
}

.sc-exit-btn {
    color: #ff8ba3;
    border-color: rgba(255, 102, 133, 0.22);
}

.sc-exit-btn:hover {
    color: #fff;
    background: rgba(255, 102, 133, 0.12);
    border-color: rgba(255, 102, 133, 0.42);
}

/* Main workspace */
.sc-chat-workspace {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 68px 276px minmax(320px, 1fr) 0;
    overflow: hidden;
    position: relative;
    z-index: 1;
    transition: grid-template-columns 180ms ease;
}

.sc-chat-app.packets-open .sc-chat-workspace {
    grid-template-columns: 68px 276px minmax(320px, 1fr) 238px;
}

/* Navigation rail */
.sc-navrail {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 14px 8px;
    background: #080c0a;
    border-right: 1px solid var(--sc-line);
}

.sc-nav-item {
    width: 52px;
    min-height: 52px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 2px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--sc-dim);
    background: transparent;
    cursor: pointer;
    transition: 150ms ease;
}

.sc-nav-item:hover {
    color: var(--sc-text);
    background: rgba(255, 255, 255, 0.025);
}

.sc-nav-item.active {
    color: var(--sc-green);
    border-color: var(--sc-line-strong);
    background: rgba(138, 255, 183, 0.065);
    box-shadow: inset 0 0 18px rgba(38, 245, 138, 0.035);
}

.sc-nav-icon {
    font: 700 15px/1 'Fira Code', monospace;
}

.sc-nav-label {
    font: 600 6.5px/1 'Orbitron', sans-serif;
    letter-spacing: 0.35px;
}

/* Channel directory */
.sc-sidebar {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background: var(--sc-panel);
    border-right: 1px solid var(--sc-line);
}

.sc-sidebar-head {
    min-height: 67px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 13px 14px 11px;
}

.sc-sidebar-head h2 {
    margin: 4px 0 0;
    color: var(--sc-text);
    font: 600 13px/1.2 'Orbitron', sans-serif;
    letter-spacing: 0.2px;
}

.sc-sidebar-close,
.sc-mobile-menu {
    display: none;
}

.sc-chat-actions {
    display: flex;
    min-height: 0;
    padding: 0 12px 8px;
}

.sc-chat-actions:empty {
    display: none;
}

.sc-chat-action-btn {
    width: 100%;
    min-height: 32px;
    border: 1px solid rgba(121, 233, 255, 0.18);
    border-radius: 6px;
    color: var(--sc-cyan);
    background: rgba(121, 233, 255, 0.045);
    font: 600 8px/1 'Orbitron', sans-serif;
    letter-spacing: 0.7px;
    cursor: pointer;
}

.sc-chat-action-btn:hover {
    color: #e9fbff;
    background: rgba(121, 233, 255, 0.1);
}

.sc-search-box {
    height: 36px;
    margin: 0 12px 10px;
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 0 9px;
    border: 1px solid var(--sc-line);
    border-radius: 7px;
    color: var(--sc-dim);
    background: rgba(0, 0, 0, 0.19);
}

.sc-search-box:focus-within {
    border-color: rgba(121, 233, 255, 0.32);
    box-shadow: 0 0 0 2px rgba(121, 233, 255, 0.04);
}

.sc-search-box input {
    flex: 1;
    min-width: 0;
    border: 0;
    outline: 0;
    color: var(--sc-text);
    background: transparent;
    font: 400 10px/1 'Fira Code', monospace;
}

.sc-search-box input::placeholder {
    color: var(--sc-dim);
}

.sc-search-box kbd {
    padding: 3px 4px;
    border: 1px solid var(--sc-line);
    border-radius: 3px;
    color: var(--sc-dim);
    font: 500 7px/1 'Fira Code', monospace;
    white-space: nowrap;
}

.sc-chat-list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0 8px 10px;
}

.sc-chat-list::-webkit-scrollbar,
.sc-chat-thread::-webkit-scrollbar,
.sc-packet-log::-webkit-scrollbar {
    width: 4px;
}

.sc-chat-list::-webkit-scrollbar-thumb,
.sc-chat-thread::-webkit-scrollbar-thumb,
.sc-packet-log::-webkit-scrollbar-thumb {
    border-radius: 4px;
    background: rgba(138, 255, 183, 0.16);
}

.sc-chat-list .sidebar-item {
    width: 100%;
    min-width: 0;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    margin: 0 0 3px;
    padding: 8px 9px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--sc-text);
    background: transparent;
    text-align: left;
    font-family: 'Fira Code', monospace;
    cursor: pointer;
    transition: 130ms ease;
}

.sc-chat-list .sidebar-item::before {
    content: attr(data-avatar);
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(121, 233, 255, 0.16);
    border-radius: 10px;
    color: var(--sc-cyan);
    background: rgba(121, 233, 255, 0.055);
    font: 700 10px/1 'Fira Code', monospace;
}

.sc-chat-list .sidebar-item[data-channel^="global"]::before {
    content: '#';
    color: var(--sc-green);
    border-color: var(--sc-line-strong);
    background: rgba(138, 255, 183, 0.06);
}

.sc-chat-list .sidebar-item[data-channel^="group"]::before {
    content: '⬡';
    color: #cf9cff;
}

.sc-chat-list .sidebar-item[data-channel^="clan"]::before {
    content: '⚑';
    color: var(--sc-gold);
}

.sc-chat-list .sidebar-item:hover {
    background: rgba(255, 255, 255, 0.026);
}

.sc-chat-list .sidebar-item.active {
    border-color: var(--sc-line-strong);
    background: linear-gradient(90deg, rgba(38, 245, 138, 0.09), rgba(38, 245, 138, 0.025));
    box-shadow: inset 2px 0 var(--sc-green-strong);
}

.sc-chat-list .si-body {
    min-width: 0;
}

.sc-chat-list .si-title {
    overflow: hidden;
    color: inherit;
    font-size: 10.5px;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-chat-list .si-sub {
    overflow: hidden;
    margin-top: 3px;
    color: var(--sc-dim);
    font-size: 8.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-chat-list .sc-unread {
    min-width: 17px;
    height: 17px;
    box-sizing: border-box;
    display: grid;
    place-items: center;
    padding: 0 4px;
    border-radius: 10px;
    color: #041008;
    background: var(--sc-green);
    font: 700 8px/1 'Fira Code', monospace;
}

.sc-chat-list .sidebar-empty {
    margin: 6px;
    padding: 22px 12px;
    border: 1px dashed var(--sc-line);
    border-radius: 8px;
    color: var(--sc-dim);
    font-size: 9px;
    line-height: 1.6;
    text-align: center;
}

.sc-chat-list .sidebar-request {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 2px 5px;
    padding: 9px;
    border: 1px solid rgba(255, 211, 107, 0.17);
    border-radius: 7px;
    color: var(--sc-text);
    background: rgba(255, 211, 107, 0.035);
    font-size: 9px;
}

.sc-chat-list .sidebar-request span {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sc-chat-list .mini-btn {
    width: 25px;
    height: 25px;
    border: 1px solid var(--sc-line);
    border-radius: 5px;
    color: var(--sc-green);
    background: rgba(255, 255, 255, 0.02);
    cursor: pointer;
}

.sc-sidebar-foot {
    height: 31px;
    flex: 0 0 31px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    border-top: 1px solid var(--sc-line);
    color: var(--sc-dim);
    font-size: 7.5px;
}

.sc-sidebar-foot span:first-child {
    color: #599b70;
}

/* Conversation */
.sc-conversation {
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    background:
        linear-gradient(rgba(7, 10, 9, 0.96), rgba(7, 10, 9, 0.96)),
        repeating-linear-gradient(90deg, transparent 0 39px, rgba(138, 255, 183, 0.025) 39px 40px),
        repeating-linear-gradient(0deg, transparent 0 39px, rgba(138, 255, 183, 0.025) 39px 40px);
}

.sc-channelbar {
    height: 66px;
    flex: 0 0 66px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 0 16px;
    border-bottom: 1px solid var(--sc-line);
    background: rgba(11, 16, 14, 0.83);
}

.sc-chat-avatar {
    width: 37px;
    height: 37px;
    flex: 0 0 37px;
    display: grid;
    place-items: center;
    border: 1px solid var(--sc-line-strong);
    border-radius: 11px;
    color: var(--sc-green);
    background: rgba(138, 255, 183, 0.055);
    box-shadow: none;
    font-size: 15px;
}

.sc-channel-identity {
    min-width: 0;
    flex: 1;
}

.sc-chat-channel-name {
    overflow: hidden;
    color: var(--sc-text);
    font: 600 12px/1.2 'Orbitron', sans-serif;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-chat-channel-sub {
    overflow: hidden;
    margin-top: 4px;
    color: var(--sc-muted);
    font-size: 8.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sc-channel-security {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    border: 1px solid var(--sc-line);
    border-radius: 5px;
    color: #69a77e;
    font: 600 7px/1 'Orbitron', sans-serif;
}

.sc-security-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--sc-green-strong);
    box-shadow: 0 0 6px var(--sc-green-strong);
}

.sc-chat-panes {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
}

.sc-chat-pane {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    min-height: 0;
}

.sc-chat-pane.active {
    display: flex;
}

.sc-chat-pane-head {
    height: 25px;
    flex: 0 0 25px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    padding: 0 17px;
    border-bottom: 1px solid rgba(151, 255, 194, 0.055);
    color: var(--sc-dim);
    font: 500 7px/1 'Fira Code', monospace;
    letter-spacing: 0.55px;
}

.sc-chat-pane-head em {
    margin: 0 4px;
    color: #6d9d7d;
    font-style: normal;
}

.sc-chat-thread {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
    padding: 18px clamp(14px, 3vw, 34px) 14px;
    scroll-behavior: smooth;
}

.sc-chat-thread .system-msg {
    align-self: center;
    max-width: min(620px, 90%);
    box-sizing: border-box;
    margin: 3px 0;
    padding: 7px 11px;
    border: 1px dashed var(--sc-line);
    border-radius: 6px;
    color: var(--sc-dim);
    background: rgba(255, 255, 255, 0.012);
    font-size: 8px;
    line-height: 1.45;
    text-align: center;
}

.sc-chat-thread .msg-bubble {
    width: fit-content;
    max-width: min(72%, 680px);
    box-sizing: border-box;
    padding: 9px 11px 7px;
    border: 1px solid var(--sc-line);
    border-radius: 5px 13px 13px 13px;
    color: var(--sc-text);
    background: rgba(16, 23, 19, 0.93);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.13);
    font-size: 10.5px;
    line-height: 1.5;
    animation: sc-message-enter 160ms ease-out;
}

@keyframes sc-message-enter {
    from { opacity: 0; transform: translateY(4px); }
}

.sc-chat-thread .msg-bubble--in {
    align-self: flex-start;
    border-left-color: rgba(121, 233, 255, 0.52);
}

.sc-chat-thread .msg-bubble--out {
    align-self: flex-end;
    border-color: rgba(138, 255, 183, 0.2);
    border-radius: 13px 5px 13px 13px;
    background: rgba(18, 42, 29, 0.88);
}

.sc-chat-thread .msg-bubble-author {
    margin-bottom: 4px;
    color: var(--sc-cyan);
    font: 600 8px/1.2 'Orbitron', sans-serif;
    letter-spacing: 0.3px;
}

.sc-chat-thread .msg-bubble-body {
    overflow-wrap: anywhere;
}

.sc-chat-thread .msg-bubble-time {
    display: block;
    margin-top: 4px;
    color: var(--sc-dim);
    font-size: 7px;
    text-align: right;
}

.sc-chat-thread .msg-bubble-body a {
    color: var(--sc-cyan);
}

.sc-chat-typing {
    min-height: 18px;
    box-sizing: border-box;
    padding: 1px 20px 3px;
    color: var(--sc-muted);
    font-size: 8px;
}

/* Moderation */
.sc-moderation-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 16px;
    border-top: 1px solid rgba(255, 102, 133, 0.24);
    color: #ff9caf;
    background: rgba(255, 102, 133, 0.075);
    font-size: 8.5px;
}

.sc-moderation-banner[hidden] {
    display: none;
}

.sc-moderation-icon {
    color: var(--sc-red);
}

.sc-chat-thread .sc-message-blocked {
    min-width: min(340px, 75%);
    color: #ff9caf;
    border-color: rgba(255, 102, 133, 0.25);
    background: rgba(52, 16, 23, 0.86);
}

.sc-blocked-content {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 8.5px;
}

.sc-image-quarantine {
    position: relative;
    min-width: 220px;
    min-height: 120px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 102, 133, 0.2);
    border-radius: 7px;
}

.sc-image-quarantine img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(28px) brightness(0.2);
    transform: scale(1.18);
}

.sc-image-quarantine span {
    z-index: 1;
    max-width: 180px;
    color: #ff9caf;
    font-size: 8.5px;
    text-align: center;
}

/* Composer */
body.messenger-chat-ui #phase-chat .sc-chat-composer {
    min-height: 72px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-top: 1px solid var(--sc-line);
    background: rgba(11, 16, 14, 0.98);
}

.sc-chat-attach {
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    border: 1px solid var(--sc-line);
    border-radius: 8px;
    color: var(--sc-muted);
    background: rgba(255, 255, 255, 0.018);
    font-size: 17px;
    cursor: pointer;
}

.sc-chat-attach.sc-attachment-disabled {
    opacity: 0.27;
    cursor: not-allowed;
}

.sc-compose-field {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 7px 10px 5px;
    border: 1px solid var(--sc-line);
    border-radius: 9px;
    background: rgba(0, 0, 0, 0.17);
}

.sc-compose-field:focus-within {
    border-color: rgba(121, 233, 255, 0.3);
    box-shadow: 0 0 0 2px rgba(121, 233, 255, 0.035);
}

body.messenger-chat-ui #phase-chat #message-input {
    width: 100%;
    min-height: 18px;
    max-height: 96px;
    box-sizing: border-box;
    resize: none;
    overflow-y: auto;
    padding: 0;
    border: 0;
    outline: 0;
    color: var(--sc-text);
    background: transparent;
    font: 400 10px/1.45 'Fira Code', monospace;
}

body.messenger-chat-ui #phase-chat #message-input::placeholder {
    color: var(--sc-dim);
}

.sc-compose-hint {
    color: #39453f;
    font-size: 6.5px;
}

body.messenger-chat-ui #phase-chat .sc-chat-send {
    height: 42px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 13px;
    border: 1px solid rgba(138, 255, 183, 0.28);
    border-radius: 8px;
    color: #071109;
    background: linear-gradient(135deg, var(--sc-green), #54e994);
    font: 700 7.5px/1 'Orbitron', sans-serif;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.sc-chat-send b {
    font-size: 13px;
}

.sc-chat-send:hover {
    filter: brightness(1.08);
    box-shadow: 0 0 18px rgba(38, 245, 138, 0.15);
}

.sc-chat-send:disabled,
#message-input:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

/* Packet trace drawer */
.sc-packet-side {
    min-width: 0;
    min-height: 0;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border-left: 1px solid rgba(121, 233, 255, 0.13);
    background: #080d0f;
}

.sc-chat-app.packets-open .sc-packet-side {
    display: flex;
}

.sc-packet-head {
    min-height: 67px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 12px;
    border-bottom: 1px solid rgba(121, 233, 255, 0.1);
}

.sc-packet-head div {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sc-packet-head strong {
    color: var(--sc-cyan);
    font: 600 10px/1 'Orbitron', sans-serif;
}

.sc-packet-head button,
.sc-sidebar-close,
.sc-mobile-menu {
    border: 0;
    color: var(--sc-muted);
    background: transparent;
    cursor: pointer;
    font-size: 18px;
}

.sc-packet-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 8px;
}

.sc-packet-stats div {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 8px;
    border: 1px solid rgba(121, 233, 255, 0.09);
    border-radius: 6px;
}

.sc-packet-stats span {
    color: var(--sc-dim);
    font-size: 6.5px;
}

.sc-packet-stats b {
    color: var(--sc-cyan);
    font-size: 7.5px;
}

.sc-packet-log {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 8px 10px;
    color: var(--sc-dim);
    font-size: 7.5px;
    line-height: 1.5;
}

.sc-packet-line {
    margin-bottom: 5px;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(121, 233, 255, 0.05);
    overflow-wrap: anywhere;
}

.sc-packet-line .pkt-type { color: var(--sc-cyan); }
.sc-packet-line .pkt-in { color: var(--sc-green); }
.sc-packet-line .pkt-out { color: var(--sc-gold); }

.sc-jump-fab {
    position: absolute;
    right: 20px;
    bottom: 82px;
    z-index: 30;
    padding: 7px 10px;
    border: 1px solid var(--sc-line-strong);
    border-radius: 14px;
    color: var(--sc-green);
    background: rgba(8, 12, 10, 0.95);
    font: 600 7px/1 'Orbitron', sans-serif;
    cursor: pointer;
}

.sc-jump-fab.hidden {
    display: none;
}

/* Suppress old gray messenger styles */
body.messenger-chat-ui .sc-chat-app,
body.messenger-chat-ui .sc-sidebar,
body.messenger-chat-ui .sc-shellbar,
body.messenger-chat-ui .sc-conversation {
    border-color: var(--sc-line);
}

/* Responsive */
@media (max-width: 980px) {
    .sc-shellbar {
        grid-template-columns: 1fr auto;
    }

    .sc-shell-session {
        display: none;
    }

    .sc-chat-workspace {
        grid-template-columns: 62px 242px minmax(300px, 1fr) 0;
    }

    .sc-chat-app.packets-open .sc-chat-workspace {
        grid-template-columns: 62px 242px minmax(300px, 1fr) 205px;
    }

    .sc-desktop-only {
        display: none;
    }
}

@media (max-width: 720px) {
    .sc-shellbar {
        height: 52px;
        flex-basis: 52px;
        padding: 0 9px;
    }

    .sc-shell-name span,
    .sc-icon-btn:not(#sc-toggle-packets) {
        display: none;
    }

    .sc-icon-btn,
    .sc-exit-btn {
        padding: 0 8px;
        font-size: 7px;
    }

    .sc-exit-btn {
        max-width: 60px;
        overflow: hidden;
        white-space: nowrap;
    }

    .sc-chat-workspace,
    .sc-chat-app.packets-open .sc-chat-workspace {
        grid-template-columns: 1fr;
        padding-bottom: 55px;
    }

    .sc-navrail {
        position: absolute;
        z-index: 24;
        right: 0;
        bottom: 0;
        left: 0;
        height: 55px;
        box-sizing: border-box;
        flex-direction: row;
        justify-content: space-around;
        gap: 2px;
        padding: 4px 8px;
        border-top: 1px solid var(--sc-line-strong);
        border-right: 0;
    }

    .sc-nav-item {
        width: min(22vw, 76px);
        min-height: 45px;
        flex-direction: row;
        gap: 6px;
    }

    .sc-sidebar {
        position: absolute;
        z-index: 26;
        top: 0;
        bottom: 55px;
        left: 0;
        width: min(86vw, 320px);
        box-shadow: 18px 0 50px rgba(0, 0, 0, 0.52);
        transform: translateX(-105%);
        transition: transform 180ms ease;
    }

    .sc-chat-app.channels-open .sc-sidebar {
        transform: translateX(0);
    }

    .sc-sidebar-close,
    .sc-mobile-menu {
        display: block;
    }

    .sc-conversation {
        grid-column: 1;
    }

    .sc-channelbar {
        height: 58px;
        flex-basis: 58px;
        padding: 0 10px;
    }

    .sc-mobile-menu {
        width: 28px;
        flex: 0 0 28px;
        padding: 0;
        font-size: 16px;
    }

    .sc-channel-security {
        display: none;
    }

    .sc-chat-thread {
        padding: 12px 10px;
    }

    .sc-chat-thread .msg-bubble {
        max-width: 88%;
        font-size: 10px;
    }

    body.messenger-chat-ui #phase-chat .sc-chat-composer {
        min-height: 64px;
        padding: 8px;
        gap: 7px;
    }

    .sc-chat-attach {
        width: 29px;
        height: 29px;
        flex-basis: 29px;
    }

    .sc-compose-hint {
        display: none;
    }

    body.messenger-chat-ui #phase-chat .sc-chat-send {
        width: 40px;
        height: 38px;
        justify-content: center;
        padding: 0;
    }

    .sc-chat-send span {
        display: none;
    }

    .sc-packet-side {
        position: absolute;
        z-index: 28;
        inset: 0 0 55px auto;
        width: min(88vw, 300px);
        box-shadow: -18px 0 50px rgba(0, 0, 0, 0.52);
    }
}

/* Desktop mobile-preview button */
#app-container.mobile-view .sc-shellbar {
    grid-template-columns: 1fr auto;
}

#app-container.mobile-view .sc-shell-session {
    display: none;
}

#app-container.mobile-view .sc-chat-workspace,
#app-container.mobile-view .sc-chat-app.packets-open .sc-chat-workspace {
    grid-template-columns: 58px 230px minmax(280px, 1fr) 0;
}

#app-container.mobile-view .sc-chat-app.packets-open .sc-packet-side {
    position: absolute;
    z-index: 28;
    inset: 0 0 0 auto;
    width: 230px;
    box-shadow: -18px 0 50px rgba(0, 0, 0, 0.52);
}
