@import url('./community_common.css?v=20260519');

:root {
            --x-blue: var(--community-blue);
            --x-blue-hover: var(--community-blue-hover);
            --x-bg: var(--community-bg);
            --x-text: var(--community-text);
            --x-subtext: var(--community-subtext);
            --x-border: var(--community-border);
            --x-soft: var(--community-soft);
        }

        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background-color: var(--x-bg);
            color: var(--x-text);
        }

        /* ===== conversations toggle button (mobile only) ===== */
        .conversations-toggle-btn {
            display: none;
            background: transparent;
            border: none;
            color: var(--x-subtext);
            font-size: 18px;
            cursor: pointer;
            padding: 6px;
            border-radius: 50%;
        }

        .conversations-toggle-btn:hover {
            background: #eff3f4;
            color: var(--x-text);
        }

        .sidebar-overlay {
            display: none;
        }

        .container {
            display: flex;
            max-width: 1500px;
            margin: 0 auto;
            min-height: 100vh;
            background: #fff;
        }

        .sidebar-left {
            width: 275px;
            padding: 16px;
            border-right: 1px solid var(--x-border);
            background: #fff;
        }

        .sidebar-left .logo {
            font-size: 24px;
            font-weight: 700;
            color: var(--x-blue);
            margin-bottom: 14px;
        }

        .sidebar-left .menu-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 11px 14px;
            margin-bottom: 6px;
            border-radius: 999px;
            cursor: pointer;
            transition: background-color 0.2s;
            color: var(--x-text);
            text-decoration: none;
            font-weight: 500;
        }

        .sidebar-left .menu-item i {
            width: 20px;
        }

        .sidebar-left .menu-item:hover {
            background: #eff3f4;
        }

        .sidebar-left .menu-item.active {
            background: #e8f5fe;
            color: var(--x-blue);
        }

        .sidebar-left .menu-item.disabled {
            opacity: 0.6;
            cursor: default;
        }

        .menu-badge {
            background: #e0245e;
            color: white;
            border-radius: 999px;
            padding: 2px 7px;
            font-size: 12px;
            margin-left: auto;
            line-height: 1.2;
        }

        .tweet-btn {
            background: var(--x-blue);
            color: white;
            border: none;
            border-radius: 999px;
            padding: 12px 20px;
            font-size: 16px;
            font-weight: 700;
            width: 100%;
            margin-top: 20px;
            cursor: pointer;
        }

        .tweet-btn:hover {
            background: var(--x-blue-hover);
        }

        /* 左サイドバー - 会話リスト */
        .conversations {
            width: 380px;
            border-left: 1px solid var(--x-border);
            border-right: 1px solid var(--x-border);
            background: white;
            overflow-y: auto;
            max-height: 100vh;
        }

        .conversations-header {
            padding: 14px 16px;
            border-bottom: 1px solid var(--x-border);
            font-weight: 800;
            font-size: 20px;
            position: sticky;
            top: 0;
            background: rgba(255, 255, 255, 0.92);
            backdrop-filter: blur(8px);
            z-index: 10;
            display: flex;
            align-items: center;
            justify-content: space-between;
        }

        .header-meta {
            color: var(--x-subtext);
            font-size: 13px;
            font-weight: 500;
            margin-top: 2px;
        }

        .compose-btn {
            width: 34px;
            height: 34px;
            border: none;
            border-radius: 50%;
            color: var(--x-blue);
            background: transparent;
            cursor: pointer;
        }

        .compose-btn:hover {
            background: #e8f5fe;
        }

        .conversation-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            border-bottom: 1px solid var(--x-border);
            cursor: pointer;
            transition: background-color 0.2s;
            color: inherit;
            text-decoration: none;
        }

        .conversation-item:hover {
            background-color: var(--x-soft);
        }

        .conversation-item.active {
            background-color: #e8f5fe;
            box-shadow: inset 3px 0 0 var(--x-blue);
        }

        .compose-nav {
            width: 100%;
            border: none;
            text-align: left;
            background: #fff;
            font: inherit;
        }

        .compose-nav i {
            color: var(--x-blue);
            width: 44px;
            text-align: center;
            font-size: 16px;
        }

        .conversation-avatar {
            width: 44px;
            height: 44px;
            border-radius: 50%;
            background-color: #ccc;
            flex-shrink: 0;
        }

        .conversation-info {
            flex: 1;
            min-width: 0;
        }

        .conversation-top {
            display: flex;
            justify-content: space-between;
            align-items: baseline;
            gap: 10px;
            margin-bottom: 2px;
        }

        .conversation-name {
            font-weight: 700;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .conversation-last-message {
            color: var(--x-subtext);
            font-size: 14px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        .conversation-time {
            color: var(--x-subtext);
            font-size: 12px;
            white-space: nowrap;
        }

        .unread-badge {
            background: var(--x-blue);
            color: white;
            border-radius: 999px;
            padding: 2px 6px;
            font-size: 12px;
            margin-left: 8px;
            font-weight: 700;
        }

        /* 右側 - メッセージエリア */
        .messages-area {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: white;
            min-width: 0;
        }

        .messages-header {
            padding: 11px 16px;
            border-bottom: 1px solid var(--x-border);
            display: flex;
            align-items: center;
            gap: 12px;
            position: sticky;
            top: 0;
            background: rgba(255, 255, 255, 0.92);
            backdrop-filter: blur(8px);
            z-index: 20;
        }

        .messages-header-avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background-color: #ccc;
        }

        .messages-header-name {
            font-weight: 700;
            font-size: 15px;
        }

        .messages-header-sub {
            color: var(--x-subtext);
            font-size: 13px;
        }

        .messages-list {
            flex: 1;
            padding: 14px 16px 18px;
            overflow-y: auto;
            max-height: calc(100vh - 145px);
            background: var(--x-bg);
        }

        .message {
            margin-bottom: 12px;
            display: flex;
        }

        .message.sent {
            justify-content: flex-end;
        }

        .message.received {
            justify-content: flex-start;
        }

        .message-content {
            padding: 10px 14px;
            border-radius: 18px;
            position: relative;
            line-height: 1.45;
            word-break: break-word;
        }

        .message.sent .message-content {
            background-color: var(--x-blue);
            color: white;
            border-bottom-right-radius: 6px;
        }

        .message.received .message-content {
            background-color: #fff;
            border: 1px solid var(--x-border);
            color: #14171a;
            border-bottom-left-radius: 6px;
        }

        .message-meta {
            margin-top: 4px;
            font-size: 12px;
            color: var(--x-subtext);
        }

        .message.sent .message-meta {
            text-align: right;
        }

        .message-input-area {
            border-top: 1px solid var(--x-border);
            padding: 12px 16px;
            background: #fff;
            position: sticky;
            bottom: 0;
            z-index: 15;
        }

        .message-form {
            display: flex;
            align-items: center;
        }

        .message-input {
            flex: 1;
            border: 1px solid #cfd9de;
            border-radius: 999px;
            padding: 11px 16px;
            font-size: 15px;
            margin-right: 10px;
        }

        .message-input:focus {
            outline: none;
            border-color: var(--x-blue);
            box-shadow: 0 0 0 1px var(--x-blue);
        }

        .message-send-btn {
            background-color: var(--x-blue);
            color: white;
            border: none;
            border-radius: 50%;
            width: 44px;
            height: 44px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .message-send-btn:hover {
            background-color: var(--x-blue-hover);
        }

        .no-conversation {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            height: 100%;
            color: var(--x-subtext);
            font-size: 18px;
            text-align: center;
            gap: 8px;
        }

        .no-conversation-note {
            font-size: 14px;
            color: var(--x-subtext);
        }

        .recent-users {
            width: min(560px, 92%);
            margin-top: 14px;
            border: 1px solid var(--x-border);
            border-radius: 14px;
            overflow: hidden;
            background: #fff;
        }

        .recent-users-head {
            padding: 10px 12px;
            font-size: 13px;
            font-weight: 700;
            color: var(--x-subtext);
            border-bottom: 1px solid var(--x-border);
            text-align: left;
        }

        .recent-user-link {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            color: inherit;
            text-decoration: none;
            border-bottom: 1px solid var(--x-border);
        }

        .recent-user-link:last-child {
            border-bottom: none;
        }

        .recent-user-link:hover {
            background: var(--x-soft);
        }

        .recent-user-meta {
            flex: 1;
            min-width: 0;
            text-align: left;
        }

        .recent-user-name {
            font-size: 14px;
            font-weight: 700;
            color: var(--x-text);
            margin-bottom: 2px;
        }

        .recent-user-last {
            font-size: 13px;
            color: var(--x-subtext);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }

        .recent-user-time {
            font-size: 12px;
            color: var(--x-subtext);
            white-space: nowrap;
        }

        .compose-screen {
            padding: 18px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }

        .compose-screen h2 {
            font-size: 20px;
            font-weight: 800;
        }

        .compose-title-desktop {
            display: block;
        }

        .compose-form {
            display: flex;
            flex-direction: column;
            gap: 10px;
            background: #fff;
            border: 1px solid var(--x-border);
            border-radius: 14px;
            padding: 14px;
        }

        .compose-form label {
            color: var(--x-subtext);
            font-size: 13px;
            font-weight: 600;
        }

        .compose-form input,
        .compose-form textarea {
            width: 100%;
            border: 1px solid #cfd9de;
            border-radius: 12px;
            padding: 10px 12px;
            font-size: 15px;
            font-family: inherit;
        }

        .compose-form textarea {
            min-height: 120px;
            resize: vertical;
        }

        .compose-form input:focus,
        .compose-form textarea:focus {
            outline: none;
            border-color: var(--x-blue);
            box-shadow: 0 0 0 1px var(--x-blue);
        }

        .compose-error {
            color: #b42318;
            background: #fdecea;
            border: 1px solid #f6c2bd;
            border-radius: 10px;
            padding: 9px 10px;
            font-size: 13px;
        }

        .compose-submit {
            align-self: flex-end;
            border: none;
            border-radius: 999px;
            background: var(--x-blue);
            color: #fff;
            font-weight: 700;
            padding: 10px 16px;
            cursor: pointer;
        }

        .compose-submit:hover {
            background: var(--x-blue-hover);
        }

        @media (max-width: 600px) {
            .mobile-menu-btn {
                display: inline-flex;
                align-items: center;
                justify-content: center;
            }

            .conversations-toggle-btn {
                display: inline-flex;
                align-items: center;
                justify-content: center;
            }

            .compose-title-desktop {
                display: none;
            }

            .messages-header {
                padding-left: 12px;
            }

            .messages-list {
                max-height: calc(100vh - 128px);
            }

            .container {
                position: relative;
                border-left: none;
                border-right: none;
            }

            .sidebar-left {
                display: none;
            }

            .conversations {
                position: fixed;
                top: 0;
                left: 0;
                width: min(82vw, 320px);
                height: 100vh;
                z-index: 900;
                transform: translateX(-100%);
                transition: transform 0.24s ease;
                overflow-y: auto;
                box-shadow: 8px 0 24px rgba(0, 0, 0, 0.18);
            }

            body.conversations-open .conversations {
                transform: translateX(0);
            }

            .sidebar-overlay {
                position: fixed;
                inset: 0;
                background: rgba(0, 0, 0, 0.42);
                z-index: 850;
            }

            body.conversations-open .sidebar-overlay {
                display: block;
            }

            body.conversations-open {
                overflow: hidden;
            }

            .conversation-item {
                padding: 11px 14px;
            }
        }

        @media (max-width: 1200px) {
            .sidebar-left {
                display: none;
            }

            .conversations {
                border-left: none;
            }
        }
