.msx-bounty-panel {
    border: 1px solid var(--color-hairline, #e7e5e4);
    border-radius: 8px;
    background: var(--color-surface, #fff);
}

.msx-bounty-compose {
    display: grid;
    gap: 8px;
    margin: 0;
}

.msx-bounty-panel-main,
.msx-bounty-panel-meta,
.msx-bounty-panel-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.msx-bounty-panel-meta,
.msx-bounty-claims,
.msx-bounty-claim-note {
    color: var(--color-muted, #888);
    font-size: 13px;
}

.msx-bounty-compose-trigger {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.msx-bounty-compose-summary {
    color: var(--color-muted, #888);
    font-size: 13px;
}

.msx-bounty-compose-dialog {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 24px;
    background: color-mix(in srgb, var(--color-ink, #111) 34%, transparent);
}

.msx-bounty-compose-dialog[hidden],
.msx-bounty-compose [data-msx-bounty-field][hidden] {
    display: none !important;
}

.msx-bounty-compose-dialog-panel {
    display: grid;
    width: min(640px, 100%);
    max-height: min(620px, calc(100vh - 48px));
    gap: 14px;
    overflow: auto;
    border-radius: var(--radius-md, 8px);
    background: var(--color-surface, #fff);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.22);
    padding: 18px;
}

.msx-bounty-compose-dialog-head,
.msx-bounty-compose-dialog-actions {
    display: flex;
    min-height: 32px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.msx-bounty-compose-dialog-head span {
    color: var(--color-ink, #111);
    font-size: 15px;
    font-weight: 600;
}

.msx-bounty-type-options {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.msx-bounty-type-option {
    display: inline-flex;
    min-height: 32px;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0 12px;
    border: 0;
    border-radius: var(--radius-button, 8px);
    background: var(--button-secondary-bg, var(--color-canvas-soft, #f5f5f4));
    color: var(--color-muted, #78716c);
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    transition:
        color 160ms ease,
        background-color 160ms ease;
}

.msx-bounty-type-option input {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.msx-bounty-type-option:has(input:checked) {
    background: var(--control-bg-active, var(--color-primary, #111));
    color: var(--control-text-active, #fff);
}

.msx-bounty-type-option:hover,
.msx-bounty-type-option:active {
    background: var(--control-bg-active, var(--color-primary, #111));
    color: var(--control-text-active, #fff);
}

.msx-bounty-compose-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.msx-bounty-compose-grid label {
    margin: 0;
}

.msx-bounty-compose-dialog-actions .form-help {
    margin: 0;
}

.msx-bounty-compose-dialog-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.msx-bounty-panel {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    padding: 12px;
}

.msx-bounty-badge,
.msx-bounty-accepted {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 7px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--color-accent, #111) 10%, transparent);
    color: var(--color-accent, #111);
    font-size: 12px;
    line-height: 1;
}

.msx-bounty-badge-packet {
    background: color-mix(in srgb, var(--color-error, #dc2626) 10%, transparent);
    color: var(--color-error, #dc2626);
}

.msx-bounty-badge-bounty {
    background: color-mix(in srgb, #b7791f 12%, transparent);
    color: #b7791f;
}

.msx-bounty-accepted {
    background: color-mix(in srgb, #b7791f 12%, transparent);
    color: #b7791f;
}

.msx-bounty-claims {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.msx-bounty-claim-item {
    display: inline-flex;
    min-width: 0;
    max-width: 100%;
    align-items: center;
    gap: 4px;
}

.msx-bounty-claim-user {
    display: inline-block;
    overflow: hidden;
    max-width: 9em;
    text-overflow: ellipsis;
    vertical-align: bottom;
    white-space: nowrap;
}

.msx-bounty-detail-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 14px;
}

.msx-bounty-detail-summary > div {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--color-hairline, #e7e5e4);
    border-radius: 8px;
    background: var(--color-surface, #fff);
}

.msx-bounty-detail-summary span,
.msx-bounty-detail-claim-main span {
    color: var(--color-muted, #888);
    font-size: 13px;
}

.msx-bounty-detail-summary strong {
    overflow: hidden;
    color: var(--color-ink, #111);
    font-size: 16px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msx-bounty-detail-list {
    display: grid;
    gap: 8px;
}

.msx-bounty-detail-claim {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--color-hairline, #e7e5e4);
    border-radius: 8px;
    background: var(--color-surface, #fff);
}

.msx-bounty-detail-avatar {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: var(--color-surface-strong, #f0efed);
    color: var(--color-body, #4a4a4a);
    font-size: 14px;
    text-decoration: none;
}

.msx-bounty-detail-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.msx-bounty-detail-claim-main {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.msx-bounty-detail-user {
    overflow: hidden;
    color: var(--color-body, #4a4a4a);
    font-weight: 600;
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msx-bounty-detail-claim > strong {
    color: var(--color-ink, #111);
    font-size: 14px;
    white-space: nowrap;
}

.msx-bounty-reply-action {
    display: inline-flex;
    align-items: center;
}

.msx-bounty-reply-action form {
    display: inline-flex;
    margin: 0;
}

@media (max-width: 720px) {
    .msx-bounty-compose-toggle {
        width: 100%;
    }

    .msx-bounty-compose-dialog {
        padding: 12px;
    }

    .msx-bounty-compose-dialog-panel {
        max-height: calc(100vh - 24px);
        padding: 14px;
    }

    .msx-bounty-type-options,
    .msx-bounty-compose-grid {
        grid-template-columns: 1fr;
    }

    .msx-bounty-compose-dialog-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .msx-bounty-detail-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .msx-bounty-detail-claim {
        grid-template-columns: 32px minmax(0, 1fr) auto;
        padding: 9px 10px;
    }

    .msx-bounty-detail-avatar {
        width: 32px;
        height: 32px;
    }
}
