#agencies-cont {
    min-width: 900px;
    width: 80%;
    max-width: 1200px;
}

#agencies-cont form,
#agencies-cont md-dialog-content,
#agencies-cont .md-dialog-content {
    width: 100%;
    box-sizing: border-box;
}

#agencies-cont .agency-search-input {
    width: 100%;
    margin: 0 0 8px;
    padding-left: 0;
    padding-right: 0;
}

#agencies-cont .agency-search-input .md-input {
    width: 100%;
}

#agencies-cont .agency-search-empty {
    padding: 16px 0;
    color: #757575;
    font-size: 14px;
    text-align: center;
}

#agencies-cont .agency-list-scroll {
    display: block;
    width: 100%;
    max-height: 60vh;
    overflow-y: auto;
    box-sizing: border-box;
    /* padding-right: 8px;
    scrollbar-gutter: stable; */
}

#agencies-cont md-radio-button {
    margin: 0 0 2px;
    padding: 3px 8px 3px 0;
    overflow: hidden;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    white-space: normal;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

#agencies-cont md-radio-button:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

#agencies-cont md-radio-button .md-label {
    display: block !important;
    width: calc(100% - 12px) !important;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
    box-sizing: border-box;
    white-space: normal;
    pointer-events: auto;
    padding: 0;
}

#agencies-cont .agency-select-item {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 24px;
    padding: 0;
}

#agencies-cont .agency-code-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 3.25rem;
    width: 3.25rem;
    min-width: 3.25rem;
    max-width: 3.25rem;
    box-sizing: border-box;
    padding: 0 4px;
    border-radius: 3px;
    background: #e8eaed;
    color: #424242;
    font-size: 11px;
    font-weight: 600;
    font-family: "Roboto Mono", "SFMono-Regular", Menlo, Consolas, monospace;
    line-height: 18px;
    letter-spacing: 0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#agencies-cont .publishEverywhere .agency-code-badge {
    background: #fce4ec;
    color: #ca064d;
}

#agencies-cont .agency-select-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    flex: 1 1 auto;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

#agencies-cont .agency-select-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.4;
}

#agencies-cont .agency-select-tags {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    gap: 4px;
    min-width: 0;
    max-width: none;
}

#agencies-cont .agency-tag {
    display: inline-block;
    flex: 0 0 auto;
    background: #fff8e1;
    color: #6d4c41;
    border: 1px solid #e6d9a8;
    border-radius: 4px;
    padding: 2px 7px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.3;
    white-space: nowrap;
}

#agencies-cont .agency-section {
    margin-bottom: 16px;
}

#agencies-cont .agency-section:last-child {
    margin-bottom: 0;
}

#agencies-cont .agency-section-title {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #757575;
}

#agencies-cont .agency-section--publish .agency-section-title {
    color: #ca064d;
}

#agencies-cont .agency-section-box {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 8px 4px 8px 8px;
    background: #fafafa;
}

#agencies-cont .agency-section--publish .agency-section-box {
    border-color: #f3c0cf;
    background: #fffafb;
}

#agencies-cont .agency-columns {
    display: block;
    width: 100%;
}

#agencies-cont .agency-column {
    min-width: 0;
}

#agencies-cont .agency-column md-radio-button {
    padding: 3px 20px 3px 0;
}

@media (min-width: 1600px) {
    #agencies-cont .agency-columns--split {
        display: flex;
        flex-direction: row;
        align-items: flex-start;
        gap: 0;
    }

    #agencies-cont .agency-columns--split .agency-column {
        flex: 0 0 50%;
        width: 50%;
        max-width: 50%;
        box-sizing: border-box;
    }

    #agencies-cont .agency-columns--split .agency-column:first-child md-radio-button {
        padding-right: 36px;
    }

    #agencies-cont .agency-columns--split .agency-column:last-child md-radio-button {
        padding-right: 28px;
    }
}

@media (max-width: 1599px) {
    #agencies-cont .agency-columns--split .agency-column + .agency-column {
        margin-top: 2px;
        padding-top: 2px;
        border-top: 1px solid #eeeeee;
    }

    #agencies-cont .agency-section--publish .agency-columns--split .agency-column + .agency-column {
        border-top-color: #f8d7e0;
    }
}

@media (max-width: 959px) {
    #agencies-cont {
        min-width: 100%;
        width: 100%;
        max-width: 100%;
    }

    #agencies-cont form {
        display: flex;
        flex-direction: column;
        height: 100%;
        max-height: 100%;
    }

    #agencies-cont md-dialog-content {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    #agencies-cont .md-dialog-content {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    #agencies-cont .agency-list-scroll {
        flex: 1 1 auto;
        min-height: 0;
        max-height: none;
        overflow-y: auto;
    }
}

.custom-fields-container {
    margin-top: 10px;
}

.custom-fields-count {
    font-size: 12px;
    color: #6c757d;
    font-weight: normal;
    margin-left: 8px;
    display: inline-block;
    margin-bottom: 10px;
}

.custom-field-item {
    margin-bottom: 15px;
    padding: 12px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.custom-field-item:hover {
    background-color: #f1f3f4;
    border-color: #d1d5db;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.custom-field-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #dee2e6;
}

.custom-field-name {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
    text-transform: capitalize;
}

.custom-field-type {
    margin-left: 8px;
    font-size: 11px;
    color: #6c757d;
    background-color: #e9ecef;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
}

.custom-field-value {
    margin-top: 6px;
}

.value-text {
    color: #212529;
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

.json-display {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    margin: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 12px;
    line-height: 1.4;
    color: #495057;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 200px;
    overflow-y: auto;
    overflow-x: auto;
}
