/* ============================================
   モーダル基本スタイル
   ============================================ */

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 90%;
    max-height: 90%;
    overflow-y: auto;
}

/* ===== リセット・基本設定 ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #F9FAFB;
    color: #111827;
    line-height: 1.5;
}

/* ===== コンテナ・レイアウト ===== */
.container {
    display: flex;
    min-height: 100vh;
}

/* ===== サイドバー ===== */
.sidebar {
    width: 280px;
    background: #FFFFFF;
    border-right: 1px solid #E5E7EB;
    display: flex;
    flex-direction: column;
    position: relative;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid #E5E7EB;
}

.sidebar-header h1 {
    font-size: 24px;
    font-weight: 700;
    color: #111827;
}

.sidebar-subtitle {
    font-size: 12px;
    color: #6B7280;
    margin-top: 4px;
}

.sidebar-nav {
    flex: 1;
    padding: 16px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: #6B7280;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    font-size: 14px;
}

.nav-item:hover {
    background: #F9FAFB;
    color: #111827;
}

.nav-item.active {
    background: #EFF6FF;
    color: #3B82F6;
    border-right: 3px solid #3B82F6;
}

.nav-icon {
    font-size: 18px;
}

/* ===== ユーザー情報セクション ===== */
.sidebar-user {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
}

.user-info {
    padding: 12px;
    background: #F9FAFB;
    border-radius: 8px;
    border: 1px solid #E5E7EB;
    margin-bottom: 8px;
}

.user-info > div {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

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

#user-name {
    font-size: 14px;
    font-weight: 600;
    color: #1F2937;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#user-role {
    font-size: 12px;
    color: #6B7280;
}

.sidebar-user button {
    width: 100%;
    padding: 10px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #374151;
    transition: all 0.2s;
    font-family: inherit;
}

.sidebar-user button:hover {
    background: #F3F4F6;
    border-color: #9CA3AF;
}

.sidebar-user button:active {
    background: #E5E7EB;
}

/* ===== メインコンテンツ ===== */
.main-content {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.content-header h2 {
    font-size: 24px;
    font-weight: 600;
    color: #111827;
}

/* ===== ボタン ===== */
.btn-primary {
    background: #3B82F6;
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary:hover {
    background: #2563EB;
}

.btn-primary:disabled {
    background: #9CA3AF;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: #6B7280;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid #D1D5DB;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #F3F4F6;
    border-color: #9CA3AF;
}

.btn-danger {
    background: #EF4444;
    color: #FFFFFF;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #DC2626;
}

/* ===== Version タブ ===== */
.version-tabs {
    display: flex;
    gap: 8px;
    border-bottom: 1px solid #E5E7EB;
    padding-bottom: 8px;
    margin-bottom: 32px;
}

.version-tab {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 600;
    color: #6B7280;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
    background: none;
    border: none;
}

.version-tab:hover {
    color: #3B82F6;
}

.version-tab.active {
    color: #3B82F6;
}

.version-tab.active::after {
    content: '';
    position: absolute;
    bottom: -9px;
    left: 0;
    right: 0;
    height: 2px;
    background: #3B82F6;
}

/* ===== 作業帯フィルター ===== */
.workband-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.workband-filter {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s;
}

.workband-filter:hover {
    border-color: #3B82F6;
    color: #3B82F6;
}

.workband-filter.active {
    background: #3B82F6;
    color: #FFFFFF;
    border-color: #3B82F6;
}

/* ===== Epic一覧 ===== */
.epic-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ===== Epic カード ===== */
.epic-card {
    background: #FFFFFF;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.epic-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.epic-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.epic-workband-badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: #FFFFFF;
}

.badge-design { background: #3B82F6; }
.badge-config { background: #10B981; }
.badge-impl-sandbox { background: #F59E0B; }
.badge-impl-prod { background: #EF4444; }
.badge-verification { background: #8B5CF6; }
.badge-creative { background: #EC4899; }

.epic-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.epic-priority {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.priority-high {
    background: #FEE2E2;
    color: #991B1B;
}

.priority-medium {
    background: #FEF3C7;
    color: #92400E;
}

.priority-low {
    background: #DBEAFE;
    color: #1E40AF;
}

.epic-meta {
    display: flex;
    gap: 16px;
    color: #6B7280;
    font-size: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #F3F4F6;
}

.epic-description {
    color: #6B7280;
    font-size: 14px;
    line-height: 1.6;
    margin-top: 12px;
}

/* ===== 空状態 ===== */
.empty-state {
    text-align: center;
    padding: 64px 32px;
    background: #FFFFFF;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.empty-state p {
    color: #6B7280;
    font-size: 16px;
    margin-bottom: 24px;
}

/* ===== モーダル ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: #FFFFFF;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-small {
    max-width: 400px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
}

.modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6B7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #F3F4F6;
}

.modal-body {
    padding: 20px 0;
    max-height: calc(90vh - 200px); /* ヘッダーとフッターの高さを引いた残り */
    overflow-y: auto; /* スクロール可能にする */
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid #E5E7EB;
}

/* ===== フォーム ===== */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.required {
    color: #EF4444;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #D1D5DB;
    border-radius: 6px;
    transition: border-color 0.2s;
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-control::placeholder {
    color: #9CA3AF;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    cursor: pointer;
}

.text-danger {
    color: #EF4444;
    font-size: 14px;
    margin-top: 8px;
}

/* ===== トースト通知 ===== */
.toast {
    position: fixed;
    bottom: 32px;
    right: 32px;
    background: #111827;
    color: #FFFFFF;
    padding: 12px 20px;
    border-radius: 6px;
    font-size: 14px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.toast.success {
    background: #10B981;
}

.toast.error {
    background: #EF4444;
}

/* ===== ローディング ===== */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1500;
}

.loading-spinner {
    border: 4px solid #F3F4F6;
    border-top: 4px solid #3B82F6;
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 0.8s linear infinite;
}

/* ===== アニメーション ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== レスポンシブ ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        transition: left 0.3s;
        z-index: 100;
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        padding: 16px;
    }

    .modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .epic-header {
        flex-wrap: wrap;
    }

    .epic-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* トースト通知アニメーション */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

/* モーダルオーバーレイ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* モーダルコンテンツ */
.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* モーダル内のフォーム要素 */
.modal-content input,
.modal-content textarea,
.modal-content select {
    width: 100%;
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
}

.modal-content textarea {
    resize: vertical;
    font-family: inherit;
}

.modal-content button[type="submit"] {
    background: #3b82f6;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.modal-content button[type="submit"]:hover {
    background: #2563eb;
}

.modal-content button[type="button"] {
    background: #ffffff;
    color: #374151;
    padding: 10px 20px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.modal-content button[type="button"]:hover {
    background: #f3f4f6;
}

/* ========================================
   提案管理画面
   ======================================== */

.status-filters {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.status-filter {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}

.status-filter:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.status-filter.active {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.suggestion-list {
    display: grid;
    gap: 16px;
}

.suggestion-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: all 0.2s;
}

.suggestion-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.suggestion-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.suggestion-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    flex: 1;
}

.suggestion-priority {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.suggestion-description {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 16px 0;
}

.suggestion-meta {
    display: flex;
    gap: 16px;
    align-items: center;
    font-size: 12px;
}

.suggestion-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
}

/* スライドインアニメーション */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* レスポンシブ対応 */
@media (max-width: 1024px) {
    #suggestion-detail-panel {
        width: 400px !important;
    }
}

@media (max-width: 768px) {
    #suggestion-detail-panel {
        width: 100% !important;
        left: 0;
        right: 0;
    }
    
    .status-filters {
        flex-wrap: wrap;
    }
}

/* ============================================
   Rule Inbox スタイル
   ============================================ */

.rule-list {
    margin-top: 24px;
}

.rule-card {
    transition: transform 0.2s, box-shadow 0.2s;
}

.rule-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

.rule-card button:hover {
    opacity: 0.9;
    transform: scale(1.05);
}

.rule-card button:active {
    transform: scale(0.95);
}

/* ================================
   User Management スタイル
   ================================ */

.user-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.user-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: box-shadow 0.2s;
}

.user-card:hover {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.user-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f3f4f6;
}

.user-card-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px 0;
}

.user-email {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.user-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.user-card-body {
    margin-bottom: 16px;
}

.user-card-body p {
    font-size: 14px;
    color: #4b5563;
    margin: 8px 0;
}

.user-card-footer {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
}

.badge-primary {
    background: #3b82f6;
}

.badge-secondary {
    background: #6b7280;
}

.badge-success {
    background: #10b981;
}

.badge-gray {
    background: #9ca3af;
}

.btn-danger {
    background: #ef4444;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #dc2626;
}

/* =====================================
   Commander's Chat スタイル
   ===================================== */

.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 300px);
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-message {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

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

.chat-message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.chat-message.assistant .message-avatar {
    background: #3B82F6;
}

.chat-message.user .message-avatar {
    background: #10B981;
}

.chat-message.system {
    background: #f0fdf4;
    border-left: 3px solid #10b981;
}

.chat-message.system .message-author {
    color: #10b981;
}

.message-content {
    flex: 1;
    max-width: 70%;
}

.chat-message.user .message-content {
    text-align: right;
}

.message-author {
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    margin-bottom: 4px;
}

.message-text {
    background: #F3F4F6;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: #111827;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.chat-message.user .message-text {
    background: #DBEAFE;
}

.chat-message.assistant .message-text {
    background: #F3F4F6;
}

.chat-input-container {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    background: #F9FAFB;
    border-top: 1px solid #E5E7EB;
}

.chat-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s;
}

.chat-input:focus {
    outline: none;
    border-color: #3B82F6;
}

.chat-input::placeholder {
    color: #9CA3AF;
}

#chat-send-btn {
    height: fit-content;
    align-self: flex-end;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

#chat-send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ローディング表示 */
.chat-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: #F3F4F6;
    border-radius: 12px;
    font-size: 14px;
    color: #6B7280;
}

.chat-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* =====================================
   Phase 20-4: チャット履歴UI改善
   ===================================== */

/* メッセージヘッダー（著者名 + タイムスタンプ） */
.message-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.message-author {
    font-weight: 600;
    font-size: 13px;
    color: #374151;
}

.message-time {
    font-size: 11px;
    color: #9CA3AF;
}

/* マークダウンスタイル */
.message-text h1,
.message-text h2,
.message-text h3 {
    margin-top: 12px;
    margin-bottom: 8px;
    font-weight: 600;
}

.message-text h1 {
    font-size: 18px;
    border-bottom: 2px solid #E5E7EB;
    padding-bottom: 4px;
}

.message-text h2 {
    font-size: 16px;
}

.message-text h3 {
    font-size: 14px;
}

.message-text ul,
.message-text ol {
    margin: 8px 0;
    padding-left: 20px;
}

.message-text li {
    margin: 4px 0;
}

.message-text p {
    margin: 8px 0;
    line-height: 1.6;
}

.message-text code {
    background: #F3F4F6;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
}

.message-text pre {
    background: #1F2937;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 12px 0;
}

.message-text pre code {
    background: transparent;
    padding: 0;
    color: #E5E7EB;
    font-size: 13px;
    line-height: 1.5;
}

.message-text blockquote {
    border-left: 4px solid #3B82F6;
    padding-left: 12px;
    margin: 12px 0;
    color: #6B7280;
    font-style: italic;
}

.message-text strong {
    font-weight: 600;
    color: #111827;
}

.message-text em {
    font-style: italic;
}

.message-text a {
    color: #3B82F6;
    text-decoration: underline;
}

.message-text a:hover {
    color: #2563EB;
}

/* テーブルスタイル（マークダウンテーブル用） */
.message-text table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
    font-size: 13px;
}

.message-text th,
.message-text td {
    border: 1px solid #E5E7EB;
    padding: 8px;
    text-align: left;
}

.message-text th {
    background: #F3F4F6;
    font-weight: 600;
}

.message-text tr:hover {
    background: #F9FAFB;
}

/* コードブロックのシンタックスハイライト調整 */
.message-text pre code.hljs {
    display: block;
    padding: 0;
}

/* ============================================
   Epic詳細モーダル
   ============================================ */
/* Epic詳細 - タイトルセクション */
.epic-detail-title-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 2px solid #E5E7EB;
}

.epic-detail-title-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin-top: 8px;
    margin-bottom: 0;
}

/* アコーディオン - セクショントグル */
.section-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 8px 0;
    transition: color 0.2s;
}

.section-toggle:hover {
    color: #3B82F6;
}

.toggle-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 14px;
}

.toggle-icon.collapsed {
    transform: rotate(-90deg);
}

/* アコーディオン - セクションコンテンツ */
.section-content {
    max-height: 1000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.section-content.collapsed {
    max-height: 0;
    opacity: 0;
}

/* タスクシンプルリスト */
.task-simple-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.task-simple-list li {
    padding: 8px 12px;
    margin-bottom: 4px;
    background: #F9FAFB;
    border-radius: 4px;
    font-size: 14px;
    color: #374151;
}

.task-simple-list li:hover {
    background: #F3F4F6;
}

.task-simple-list li.completed {
    color: #6B7280;
    text-decoration: line-through;
}

/* アクションボタン */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.action-buttons button {
    width: 100%;
}

.btn-danger {
    background: #EF4444;
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}

.btn-danger:hover {
    background: #DC2626;
}

.epic-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
}

.epic-detail-modal.show {
    display: block;
}

.epic-detail-modal .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

.epic-detail-modal .modal-content {
    position: fixed;
    right: 0;
    top: 0;
    width: 600px;
    max-width: 90vw;
    height: 100vh;
    margin: 0;
    border-radius: 0;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    z-index: 2;
    background: white;
}

.epic-detail-modal.show .modal-content {
    transform: translateX(0);
}

.epic-detail-section {
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid #E5E7EB;
}

.epic-detail-section:last-child {
    border-bottom: none;
}

.epic-detail-section h3 {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
}

.epic-detail-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
}

.epic-detail-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
}

.info-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.info-label {
    font-size: 14px;
    color: #6B7280;
    min-width: 80px;
}

.epic-detail-description-text {
    font-size: 14px;
    color: #374151;
    line-height: 1.6;
    white-space: pre-wrap;
}

.epic-task-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.epic-task-item {
    background: #F9FAFB;
    padding: 12px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.epic-task-item:hover {
    background: #F3F4F6;
}

.task-status-icon {
    font-size: 18px;
}

.task-title {
    flex: 1;
    font-size: 14px;
    color: #111827;
}

.task-assignee {
    font-size: 12px;
    color: #6B7280;
}

.empty-message {
    text-align: center;
    color: #9CA3AF;
    font-size: 14px;
    padding: 24px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .epic-detail-modal .modal-content {
        width: 100vw;
        max-width: 100vw;
    }
}

/* ============================================
   Epic アクションモーダル（複製・移動・削除）
   ============================================ */

.action-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.action-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 3001;
}

.action-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #E5E7EB;
}

.action-modal-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: #111827;
    margin: 0;
}

.action-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6B7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background 0.2s;
}

.action-modal-close:hover {
    background: #F3F4F6;
}

.action-modal-body {
    padding: 24px;
}