* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #0d1117;
    color: #c9d1d9;
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

header {
    flex-shrink: 0;
    padding: 20px 20px 0 20px;
}

h1 {
    color: #58a6ff;
    margin-bottom: 20px;
    text-align: center;
    white-space: nowrap;
    font-size: clamp(1.2rem, 5vw, 2rem);
}

#scrollable-content {
    flex: 1;
    overflow-y: auto;
    padding: 0 20px 20px 20px;
}

.view-switcher {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.view-btn {
    padding: 8px 16px;
    background: #161b22;
    border: 1px solid #30363d;
    color: #c9d1d9;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.view-btn:hover {
    background: #21262d;
    border-color: #58a6ff;
}

.view-btn.active {
    background: #238636;
    border-color: #238636;
    color: white;
}

.config-section {
    background: #161b22;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    border: 1px solid #30363d;
}

.config-header {
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.config-header:hover {
    opacity: 0.8;
}

.config-title {
    font-size: 16px;
    font-weight: 600;
    color: #58a6ff;
    display: flex;
    align-items: center;
    gap: 8px;
}

.config-collapse-icon {
    transition: transform 0.2s;
    color: #8b949e;
    font-size: 14px;
}

.config-section.collapsed .config-collapse-icon {
    transform: rotate(-90deg);
}

.config-section.collapsed .config-content {
    display: none;
}

.input-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    color: #8b949e;
    font-size: 14px;
}

input, textarea {
    width: 100%;
    padding: 8px 12px;
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    color: #c9d1d9;
    font-size: 14px;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #58a6ff;
}

textarea {
    resize: vertical;
    min-height: 80px;
    font-family: monospace;
}

button {
    background: #238636;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

button:hover {
    background: #2ea043;
}

button:disabled {
    background: #30363d;
    cursor: not-allowed;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}

.filter-group input[type="checkbox"] {
    width: auto;
    cursor: pointer;
}

.filter-group label {
    margin-bottom: 0;
    cursor: pointer;
    color: #c9d1d9;
}

.token-permissions {
    margin-top: 10px;
    padding: 10px;
    background: #0d1117;
    border-radius: 6px;
    font-size: 13px;
}

.token-permissions-header {
    cursor: pointer;
    user-select: none;
    color: #8b949e;
    display: flex;
    align-items: center;
    gap: 6px;
}

.token-permissions-header:hover {
    color: #c9d1d9;
}

.token-permissions-content {
    margin-top: 10px;
    padding-left: 20px;
    color: #8b949e;
    line-height: 1.6;
}

.token-permissions-content.hidden {
    display: none;
}

.token-permissions-content code {
    background: #161b22;
    padding: 2px 6px;
    border-radius: 3px;
    color: #c9d1d9;
    font-family: monospace;
    font-size: 12px;
}

.permission-icon {
    transition: transform 0.2s;
}

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

.main-content {
    display: flex;
    gap: 20px;
    flex: 1;
    overflow: hidden;
}

.swimlanes-wrapper {
    flex: 1;
    overflow-y: auto;
    min-width: 0;
}

.iframe-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    bottom: 20px;
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease, opacity 0.3s ease;
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    opacity: 0;
    pointer-events: none;
    z-index: 1000;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.5);
}

.iframe-panel.open {
    width: 50%;
    opacity: 1;
    pointer-events: auto;
}

.iframe-header {
    padding: 15px;
    border-bottom: 1px solid #30363d;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.iframe-title {
    color: #58a6ff;
    font-weight: 600;
    font-size: 14px;
}

.close-iframe {
    background: transparent;
    color: #8b949e;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.close-iframe:hover {
    color: #c9d1d9;
    background: #0d1117;
}

.iframe-container {
    flex: 1;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px;
}

.issue-detail-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #30363d;
}

.issue-detail-title {
    font-size: 18px;
    font-weight: 600;
    color: #c9d1d9;
    margin-bottom: 10px;
}

.issue-detail-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    font-size: 13px;
    color: #8b949e;
}

.issue-detail-body {
    color: #c9d1d9;
    line-height: 1.6;
    margin-bottom: 20px;
}

.issue-detail-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px 0;
    border-radius: 6px;
}

.issue-detail-body p {
    margin-bottom: 12px;
}

.issue-detail-body pre {
    background: #0d1117;
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    border: 1px solid #30363d;
}

.issue-detail-body code {
    background: #0d1117;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
}

.issue-detail-body pre code {
    background: transparent;
    padding: 0;
}

.comments-section {
    margin-top: 20px;
}

.comments-title {
    font-size: 16px;
    font-weight: 600;
    color: #c9d1d9;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #30363d;
}

.comment {
    background: #0d1117;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 15px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 13px;
}

.comment-author {
    color: #58a6ff;
    font-weight: 600;
}

.comment-date {
    color: #8b949e;
}

.comment-body {
    color: #c9d1d9;
    line-height: 1.6;
}

.view-on-github {
    display: inline-block;
    margin-top: 15px;
    padding: 8px 16px;
    background: #238636;
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-size: 14px;
}

.view-on-github:hover {
    background: #2ea043;
}

.swimlanes-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.swimlane {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 20px;
}

.swimlane-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #30363d;
    cursor: pointer;
    user-select: none;
}

.swimlane-header:hover {
    opacity: 0.8;
}

.swimlane-title {
    font-size: 20px;
    font-weight: 600;
    color: #58a6ff;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-direction: column;
    align-items: flex-start;
}

.swimlane-title-main {
    display: flex;
    align-items: center;
    gap: 10px;
}

.repo-link {
    font-size: 12px;
    color: #8b949e;
    text-decoration: none;
    font-weight: 400;
}

.repo-link:hover {
    color: #58a6ff;
    text-decoration: underline;
}

.collapse-icon {
    display: inline-block;
    transition: transform 0.3s ease;
    color: #8b949e;
}

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

.swimlane-content {
    max-height: 5000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

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

.swimlane-stats {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 14px;
    color: #8b949e;
}

.swimlane-stats > div {
    display: flex;
    gap: 15px;
}

.swimlane-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    max-height: 5000px;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.3s ease;
    opacity: 1;
}

.swimlane-content.single-column {
    grid-template-columns: 1fr;
}

.section {
    background: #0d1117;
    border-radius: 6px;
    padding: 15px;
}

.section-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #30363d;
}

.issues-section .section-title {
    color: #f85149;
}

.prs-section .section-title {
    color: #a371f7;
}

.item {
    background: #161b22;
    border: 1px solid #30363d;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 10px;
    transition: border-color 0.2s;
    cursor: pointer;
}

.item:hover {
    border-color: #58a6ff;
}

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

.item-title {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #c9d1d9;
    text-decoration: none;
    margin-right: 10px;
}

.item-title:hover {
    color: #58a6ff;
}

.item-number {
    color: #8b949e;
    font-size: 13px;
    white-space: nowrap;
}

.item-meta {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.label {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.label-bug {
    background: #da3633;
    color: white;
}

.label-feature {
    background: #1f6feb;
    color: white;
}

.label-enhancement {
    background: #1f6feb;
    color: white;
}

.label-task {
    background: #8957e5;
    color: white;
}

.label-other {
    background: #6e7681;
    color: white;
}

.repo-badge {
    background: #0d1117;
    color: #8b949e;
    border: 1px solid #30363d;
}

.item-state {
    font-size: 12px;
    color: #8b949e;
}

.item-dates {
    font-size: 12px;
    color: #8b949e;
}

.milestone {
    display: inline-block;
    font-size: 12px;
    color: #8b949e;
    background: #0d1117;
    padding: 2px 8px;
    border-radius: 12px;
    border: 1px solid #30363d;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #8b949e;
}

.error {
    background: #490b0b;
    border: 1px solid #f85149;
    color: #ffa198;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #8b949e;
}

.cache-detail-item {
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.cache-detail-time {
    color: #8b949e;
    white-space: nowrap;
}

@media (max-width: 768px) {
    /* View switcher: 2 buttons per row on mobile */
    .view-switcher {
        gap: 8px;
    }
    
    .view-btn {
        flex: 0 0 calc(50% - 4px);
        min-width: 0;
        padding: 8px 12px;
        font-size: 13px;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    /* Action buttons: Clear Cache and Share URL share 50% each */
    #clearCacheBtn,
    #shareBtn {
        flex: 0 0 calc(50% - 5px) !important;
    }
    
    .cache-detail-item {
        flex-direction: column;
        gap: 4px;
        padding: 6px 0;
        border-bottom: 1px solid #21262d;
    }
    
    .cache-detail-item:last-child {
        border-bottom: none;
    }
    
    .cache-detail-time {
        white-space: normal;
        font-size: 11px;
    }
    
    .swimlane-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .swimlane-stats {
        width: 100%;
        font-size: 13px;
    }
    
    .swimlane-stats > div {
        flex-wrap: wrap;
        gap: 10px;
    }

    .swimlane-content {
        grid-template-columns: 1fr;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .iframe-panel {
        width: 100%;
        height: 0;
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        border-radius: 6px 6px 0 0;
        transition: height 0.3s ease, opacity 0.3s ease;
    }
    
    .iframe-panel.open {
        width: 100% !important;
        height: 80%;
        opacity: 1;
    }
}

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