/* =============================================================
   BRANCH CLIPBOARD — modal for carrying branches between projects.
   Uses the shared terminal palette from dictation.css, so it follows
   the light/dark theme swap automatically.
   ============================================================= */

#branch-clipboard-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    font-family: inherit;
}

#bc-box {
    width: min(34rem, 100%);
    max-height: min(80dvh, 40rem);
    display: flex;
    flex-direction: column;
    background-color: var(--dict-bg, #000d00);
    color: var(--dict-fg, #00bb00);
    border: 1px solid var(--dict-border, #004400);
    border-radius: 4px;
    box-shadow: 0 0 30px var(--dict-glow, rgba(0, 255, 0, 0.25));
    overflow: hidden;
}

#bc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.7em 0.85em;
    border-bottom: 1px solid var(--dict-border, #004400);
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--dict-fg-bright, #00ff00);
}

.bc-close {
    background: transparent;
    border: none;
    color: inherit;
    font-family: inherit;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0 0.3em;
}

#bc-current {
    padding: 0.55em 0.85em;
    font-size: 0.75rem;
    border-bottom: 1px solid var(--dict-border, #004400);
}

#bc-body {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 0.35em 0;
}

.bc-empty {
    padding: 1.4em 1.1em;
    font-size: 0.75rem;
    line-height: 1.6;
    opacity: 0.75;
    text-align: center;
}

.bc-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6em;
    padding: 0.55em 0.85em;
    border-bottom: 1px solid rgba(0, 68, 0, 0.4);
}

.bc-row:last-child {
    border-bottom: none;
}

.bc-info {
    display: flex;
    flex-direction: column;
    gap: 0.15em;
    min-width: 0;
}

.bc-title {
    font-size: 0.85rem;
    color: var(--dict-fg-bright, #00ff00);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.bc-meta {
    font-size: 0.65rem;
    opacity: 0.65;
    letter-spacing: 0.04em;
}

.bc-actions {
    display: flex;
    gap: 0.25em;
    flex: 0 0 auto;
}

.bc-actions button,
#bc-footer button {
    background: transparent;
    color: var(--dict-fg, #00bb00);
    border: 1px solid var(--dict-border, #004400);
    border-radius: 3px;
    padding: 0.4em 0.6em;
    font-family: inherit;
    font-size: 0.7rem;
    cursor: pointer;
    white-space: nowrap;
    touch-action: manipulation;
}

.bc-actions button:hover,
#bc-footer button:hover {
    color: var(--dict-fg-bright, #00ff00);
    border-color: var(--dict-fg-bright, #00ff00);
}

.bc-actions button.bc-danger:hover {
    color: var(--dict-danger, #ff4444);
    border-color: var(--dict-danger, #ff4444);
}

#bc-footer {
    display: flex;
    gap: 0.4em;
    padding: 0.6em 0.85em;
    border-top: 1px solid var(--dict-border, #004400);
}

#bc-footer button {
    flex: 1;
    padding: 0.55em 0.6em;
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    #branch-clipboard-modal {
        padding: 0;
        align-items: stretch;
    }

    #bc-box {
        width: 100%;
        max-height: none;
        height: 100dvh;
        border: none;
        border-radius: 0;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    /* Actions wrap under the title rather than squeezing it out */
    .bc-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.45em;
        padding: 0.7em 0.85em;
    }

    .bc-actions button {
        flex: 1;
        min-height: 2.5rem;
    }
}
