.agp-container {
    max-width: 1400px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.agp-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* ヘッダー */
.agp-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.agp-header h2 {
    margin: 0;
    font-size: 1.4em;
}

.agp-stats {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    color: #555;
}

.agp-stats span {
    background: #f0f4f8;
    padding: 4px 10px;
    border-radius: 4px;
}

.agp-resume-btn {
    padding: 5px 14px;
    border: 1px solid #3b82f6;
    border-radius: 6px;
    background: #3b82f6;
    color: #fff;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 600;
    transition: all 0.15s;
    white-space: nowrap;
}

.agp-resume-btn:hover {
    background: #2563eb;
    border-color: #2563eb;
}

/* ツールバー（検索 + フィルタ） */
.agp-toolbar {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    align-items: center;
}

.agp-search-bar {
    flex: 1;
}

.agp-search-bar input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    box-sizing: border-box;
}

.agp-search-bar input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.15);
}

/* フィルタボタン */
.agp-filter-bar {
    display: flex;
    gap: 0;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
}

.agp-filter-btn {
    padding: 8px 16px;
    border: none;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    transition: all 0.15s;
    border-right: 1px solid #e2e8f0;
}

.agp-filter-btn:last-child {
    border-right: none;
}

.agp-filter-btn:hover {
    background: #f1f5f9;
}

.agp-filter-btn.agp-filter-active {
    background: #1e293b;
    color: #fff;
}

.agp-filter-btn.agp-filter-llm.agp-filter-active {
    background: #1d4ed8;
}

.agp-filter-btn.agp-filter-agent.agp-filter-active {
    background: #be185d;
}

.agp-filter-btn.agp-filter-interest.agp-filter-active {
    background: #d97706;
}

/* CSVエクスポートボタン */
.agp-export-btn {
    padding: 8px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #16a34a;
    transition: all 0.15s;
    flex-shrink: 0;
}

.agp-export-btn:hover {
    background: #f0fdf4;
    border-color: #16a34a;
}

/* 日付グループ */
.agp-date-group {
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}

.agp-date-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f7fafc;
    border-bottom: 1px solid #e2e8f0;
    cursor: pointer;
    user-select: none;
}

.agp-date-header:hover {
    background: #edf2f7;
}

.agp-date-header h3 {
    margin: 0;
    font-size: 1.1em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.agp-date-header .agp-count {
    font-size: 0.85em;
    color: #666;
    font-weight: normal;
}

.agp-date-header .agp-toggle {
    font-size: 0.9em;
    color: #999;
}

/* 日付グループ完了 */
.agp-date-complete .agp-date-header {
    background: #f0fdf4;
}

/* ===== 論文単位の既読チェック ===== */
.agp-th-check,
.agp-td-check {
    width: 36px;
    min-width: 36px;
    max-width: 36px;
    text-align: center;
    padding: 6px 4px !important;
}

.agp-check-btn {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    width: 26px;
    height: 26px;
    cursor: pointer;
    font-size: 0.85em;
    color: #94a3b8;
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.3;
}

.agp-check-btn:hover {
    background: #fef3c7;
    border-color: #f59e0b;
    opacity: 1;
}

.agp-bookmark-marker {
    font-size: 1.1em;
}

.agp-row-bookmark {
    border-bottom: 2px solid #f59e0b !important;
}

.agp-row-read {
    opacity: 0.45;
}

.agp-row-read:hover {
    opacity: 0.7;
}

/* ===== プログレスバー ===== */
.agp-progress {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-left: 12px;
}

.agp-progress-bar {
    width: 80px;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.agp-progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 0.3s ease;
    background: #94a3b8;
}

.agp-progress-low .agp-progress-fill {
    background: #f59e0b;
}

.agp-progress-half .agp-progress-fill {
    background: #3b82f6;
}

.agp-progress-done .agp-progress-fill {
    background: #16a34a;
}

.agp-progress-text {
    font-size: 0.75em;
    color: #64748b;
    white-space: nowrap;
    font-weight: 500;
}

/* スクロールターゲットのハイライトアニメーション */
@keyframes agp-highlight-pulse {
    0%   { background-color: #fef08a; }
    100% { background-color: transparent; }
}

.agp-row-highlight {
    animation: agp-highlight-pulse 2s ease-out;
}

/* ===== テーブル ===== */
.agp-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.agp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
    line-height: 1.45;
    table-layout: fixed;
}

.agp-table thead {
    position: sticky;
    top: 0;
    z-index: 1;
}

.agp-table th {
    background: #f1f5f9;
    color: #475569;
    font-weight: 600;
    font-size: 0.8em;
    text-transform: none;
    letter-spacing: 0;
    padding: 8px 10px;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.agp-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
    word-break: break-word;
}

.agp-table tbody tr:hover {
    background: #f8fafc;
}

/* カラム幅 */
.agp-th-title-ja,
.agp-td-title-ja {
    width: 25%;
    min-width: 180px;
}

.agp-th-title-en,
.agp-td-title-en {
    width: 25%;
    min-width: 180px;
}

.agp-th-summary,
.agp-td-summary {
    width: 30%;
    min-width: 200px;
}

.agp-th-interest,
.agp-td-interest {
    width: 70px;
    min-width: 70px;
    text-align: center;
}

.agp-th-status,
.agp-td-status {
    width: 120px;
    min-width: 120px;
    text-align: center;
}

/* タイトルセル */
.agp-td-title-ja a,
.agp-td-title-en a {
    color: #1a202c;
    text-decoration: none;
    font-weight: 500;
}

.agp-td-title-ja a:hover,
.agp-td-title-en a:hover {
    color: #0073aa;
    text-decoration: underline;
}

.agp-td-title-en {
    font-size: 0.9em;
    color: #64748b;
}

.agp-td-title-en a {
    color: #64748b;
    font-weight: 400;
}

.agp-td-title-en a:hover {
    color: #0073aa;
}

/* メタ行（arxiv_id + PDFリンク） */
.agp-row-meta {
    margin-top: 3px;
    font-size: 0.8em;
    color: #94a3b8;
}

.agp-pdf-link {
    color: #0073aa !important;
    font-weight: 600 !important;
    margin-left: 6px;
    font-size: 0.9em;
}

.agp-pdf-link:hover {
    text-decoration: underline !important;
}

/* 要約セル */
.agp-td-summary {
    color: #475569;
    font-size: 0.88em;
    line-height: 1.5;
}

/* 未翻訳 */
.agp-not-translated {
    color: #cbd5e1;
    font-style: italic;
}

/* 検索クエリタグ */
.agp-query-tag {
    display: inline-block;
    font-size: 0.7em;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    margin-right: 4px;
    vertical-align: middle;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.agp-query-llm {
    background: #dbeafe;
    color: #1d4ed8;
}

.agp-query-agent {
    background: #fce7f3;
    color: #be185d;
}

/* ===== おもしろそうボタン ===== */
.agp-tbl-interest-btn {
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 4px 10px;
    cursor: pointer;
    font-size: 1.1em;
    color: #cbd5e1;
    transition: all 0.15s;
    white-space: nowrap;
}

.agp-tbl-interest-btn:hover {
    background: #fffbeb;
    border-color: #fbbf24;
    color: #d97706;
}

.agp-tbl-interest-btn.agp-tbl-interest-active {
    background: #fffbeb;
    border-color: currentColor;
}

.agp-interest-count-num {
    font-size: 0.75em;
    vertical-align: middle;
}

.agp-interest-count {
    color: #d97706;
    font-size: 0.9em;
}

.agp-cell-empty {
    color: #e2e8f0;
}

/* ===== ステータスボタン群 ===== */
.agp-tbl-status-group {
    display: inline-flex;
    gap: 2px;
    background: #f8fafc;
    border-radius: 6px;
    padding: 2px;
    border: 1px solid #e2e8f0;
}

.agp-tbl-status-btn {
    background: none;
    border: none;
    border-radius: 4px;
    padding: 3px 6px;
    cursor: pointer;
    font-size: 1em;
    color: #cbd5e1;
    opacity: 0.5;
    transition: all 0.15s;
}

.agp-tbl-status-btn:hover {
    opacity: 1;
    background: #f1f5f9;
}

.agp-tbl-status-btn.agp-tbl-status-active {
    opacity: 1;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0,0,0,0.08);
}

/* ===== 行のステータス色 ===== */
.agp-row-interested {
    background: #fffbeb;
}

.agp-row-good {
    background: #f0fdf4;
}

.agp-row-mediocre {
    background: #f9fafb;
}

.agp-row-pending {
    background: #eef2ff;
}

/* 空状態 */
/* 表示制限メッセージ */
.agp-limit-notice {
    padding: 16px 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-top: 1px solid #fbbf24;
    text-align: center;
    font-size: 0.9em;
    color: #92400e;
}

.agp-limit-notice p {
    margin: 0;
}

.agp-limit-notice a {
    color: #d97706;
    font-weight: 600;
    text-decoration: underline;
}

.agp-limit-notice a:hover {
    color: #b45309;
}

.agp-empty {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* ===== CSVエクスポートモーダル ===== */
.agp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.agp-modal {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    width: 420px;
    max-width: 90vw;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

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

.agp-modal-header h3 {
    margin: 0;
    font-size: 1.05em;
}

.agp-modal-close {
    background: none;
    border: none;
    font-size: 1.4em;
    cursor: pointer;
    color: #94a3b8;
    padding: 0 4px;
    line-height: 1;
}

.agp-modal-close:hover {
    color: #475569;
}

.agp-modal-body {
    padding: 16px 20px;
    overflow-y: auto;
    flex: 1;
}

.agp-modal-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 8px;
}

.agp-modal-actions button {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.85em;
    color: #3b82f6;
    font-weight: 600;
    padding: 2px 0;
}

.agp-modal-actions button:hover {
    text-decoration: underline;
}

.agp-date-check-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.agp-date-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.1s;
}

.agp-date-check-item:hover {
    background: #f1f5f9;
}

.agp-date-check-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.agp-date-check-item label {
    cursor: pointer;
    font-size: 0.92em;
    flex: 1;
}

.agp-date-check-count {
    font-size: 0.8em;
    color: #94a3b8;
}

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

.agp-modal-footer button {
    padding: 8px 20px;
    border-radius: 6px;
    font-size: 0.9em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
}

.agp-modal-cancel {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
}

.agp-modal-cancel:hover {
    background: #f1f5f9;
}

.agp-modal-submit {
    background: #16a34a;
    border: 1px solid #16a34a;
    color: #fff;
}

.agp-modal-submit:hover {
    background: #15803d;
}

.agp-modal-submit:disabled {
    background: #94a3b8;
    border-color: #94a3b8;
    cursor: not-allowed;
}

/* ===== レスポンシブ ===== */
@media (max-width: 768px) {
    .agp-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .agp-table {
        font-size: 0.8em;
    }

    .agp-th-title-en,
    .agp-td-title-en {
        display: none;
    }

    .agp-th-title-ja,
    .agp-td-title-ja {
        width: 35%;
    }

    .agp-th-summary,
    .agp-td-summary {
        width: 35%;
    }
}
