.app-related-case-picker-modal {
    position: fixed;
    inset: 0;
    z-index: 100240;
}

.app-related-case-picker__overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.48);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.app-related-case-picker__panel {
    position: relative;
    width: min(920px, calc(100vw - 32px));
    max-width: 920px;
    max-height: min(760px, calc(100vh - 48px));
    margin: auto;
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(240, 185, 11, 0.28);
    background: var(--bg-secondary, #FFFFFF);
    box-shadow: 0 28px 80px rgba(15, 23, 42, 0.32);
}

.app-related-case-picker__shell {
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: inherit;
}

.app-related-case-picker__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(135deg, #F0B90B 0%, #F8D12F 100%);
    border-bottom: 1px solid rgba(30, 35, 41, 0.08);
}

.app-related-case-picker__title-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.app-related-case-picker__title {
    font-size: 17px;
    font-weight: 800;
    color: #1E2329;
}

.app-related-case-picker__subtitle {
    font-size: 12px;
    line-height: 1.5;
    color: rgba(30, 35, 41, 0.84);
}

.app-related-case-picker__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 18px 24px;
    min-height: 0;
    overflow: auto;
    background: linear-gradient(180deg, rgba(255, 251, 240, 0.56) 0%, rgba(255, 255, 255, 1) 24%);
}

.app-related-case-picker__tabs {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 2px;
}

.app-related-case-picker__tab {
    border: none;
    background: transparent;
    border-bottom: 2px solid transparent;
    padding: 6px 2px 10px;
    font-size: 14px;
    font-weight: 700;
    color: #6B7280;
    cursor: pointer;
}

.app-related-case-picker__tab.is-active {
    color: #F0B90B;
    border-bottom-color: #F0B90B;
}

.app-related-case-picker__toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-related-case-picker__search {
    flex: 1;
    min-width: 0;
    height: 44px;
    padding: 0 16px;
    border-radius: 12px;
    border: 1px solid rgba(240, 185, 11, 0.35);
    background: rgba(255, 255, 255, 0.96);
    font-size: 14px;
    color: #1E2329;
}

.app-related-case-picker__search:focus {
    outline: none;
    border-color: #F0B90B;
    box-shadow: 0 0 0 4px rgba(240, 185, 11, 0.12);
}

.app-related-case-picker__status-trigger {
    min-width: 164px;
    max-width: 220px;
    text-align: left;
    cursor: pointer;
}

.app-related-case-picker__meta {
    font-size: 13px;
    color: #4B5563;
}

.app-related-case-picker__list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-height: 220px;
}

.app-related-case-picker__item {
    width: 100%;
    text-align: left;
    padding: 18px 16px;
    border-radius: 14px;
    border: 1px solid #E5E7EB;
    background: #FFFFFF;
    cursor: pointer;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease, background 0.18s ease;
}

.app-related-case-picker__item:hover {
    border-color: rgba(240, 185, 11, 0.58);
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
    transform: translateY(-1px);
}

.app-related-case-picker__item.is-selected {
    border-color: rgba(240, 185, 11, 0.88);
    background: rgba(240, 185, 11, 0.08);
    box-shadow: 0 0 0 1px rgba(240, 185, 11, 0.22), 0 12px 28px rgba(240, 185, 11, 0.12);
}

.app-related-case-picker__item-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.app-related-case-picker__item-num {
    font-size: 16px;
    font-weight: 800;
    color: #111827;
}

.app-related-case-picker__item-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.14);
    color: #15803D;
    font-size: 12px;
    font-weight: 700;
}

.app-related-case-picker__item-title {
    font-size: 15px;
    font-weight: 700;
    color: #1F2937;
    line-height: 1.5;
}

.app-related-case-picker__item-subtitle {
    margin-top: 6px;
    font-size: 13px;
    color: #6B7280;
    line-height: 1.6;
}

.app-related-case-picker__empty {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    border-radius: 16px;
    border: 1px dashed #D1D5DB;
    background: rgba(249, 250, 251, 0.92);
    color: #6B7280;
    font-size: 14px;
}

.app-related-case-picker__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 24px;
    border-top: 1px solid #E5E7EB;
    background: #FFFBF0;
}

.app-related-case-picker__selection {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
    flex: 1;
    min-width: 0;
    padding: 0 14px;
    border-radius: 12px;
    border: 1px solid rgba(240, 185, 11, 0.48);
    background: rgba(240, 185, 11, 0.08);
    color: #1E2329;
}

.app-related-case-picker__selection.is-empty {
    border-color: #E5E7EB;
    background: #FFFFFF;
    color: #6B7280;
}

.app-related-case-picker__selection-source {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 800;
    color: #8A5A00;
}

.app-related-case-picker__selection-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    font-weight: 700;
}

.app-related-case-picker__footer-actions {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.app-related-case-picker__footer-actions .btn-primary {
    min-width: 112px;
    box-shadow: 0 10px 24px rgba(240, 185, 11, 0.22);
}

.app-related-case-picker__header-actions,
.app-detail-link-actions {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.app-detail-link-actions {
    margin-left: auto;
}

.app-detail-link-actions .app-action-btn {
    min-height: 34px;
    padding-inline: 14px;
}

@media (max-width: 768px) {
    .app-related-case-picker__panel {
        width: calc(100vw - 20px);
        max-height: calc(100vh - 20px);
    }

    .app-related-case-picker__toolbar,
    .app-related-case-picker__footer,
    .app-related-case-picker__header {
        flex-direction: column;
        align-items: stretch;
    }

    .app-related-case-picker__status-trigger,
    .app-related-case-picker__footer-actions {
        width: 100%;
    }

    .app-related-case-picker__footer-actions {
        justify-content: flex-end;
    }
}
