/* Keep browser/pinch zoom available. Larger input text avoids focus zoom on iOS. */
@media (max-width: 768px), (pointer: coarse) {
    input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="hidden"]):not([type="button"]):not([type="submit"]),
    textarea, select {
        font-size: 16px !important;
        min-height: 44px;
        max-width: 100%;
    }
    input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; vertical-align: middle; }
    .registry-button, .registry-action-button, .details-tab,
    .registry-tab-search button, .autocomplete-clear-button {
        min-height: 44px;
    }
    .registry-tab-search button, .autocomplete-clear-button { min-width: 44px; }
    .form-field, .form-grid, .registry-tab-search { min-width: 0; }
    .registry-details-tabs { max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; }
    .registry-details-tabs .details-tab { flex-shrink: 0; }
}

@media (max-width: 576px) {
    .form-grid { grid-template-columns: minmax(0, 1fr); }
    .form-field-full { grid-column: 1 / -1; }
    .registry-details-header h1, .registry-form-heading h1 { overflow-wrap: anywhere; }
    .registry-tab-search input { width: 100%; min-width: 0; }
    .litter-modal { width: calc(100% - 24px); max-width: calc(100vw - 24px); }
}

.registry-mobile-result-count { display: none; }
@media (max-width: 768px) {
    .registry-index-heading { gap: 10px; margin-bottom: 14px; }
    .registry-tab-search { gap: 6px; padding: 6px 8px; margin-bottom: 14px; }
    .registry-tab-search input { flex: 1 1 0; width: 0; min-width: 0; }
    .registry-tab-search button { flex: 0 0 44px; }
    .registry-mobile-result-count {
        display: inline-flex; align-items: center; justify-content: center;
        flex: 0 0 auto; min-width: 36px; min-height: 36px; padding: 4px 6px;
        color: var(--club-text); background: var(--club-cream); border: 1px solid var(--club-border); border-radius: 7px;
        font-size: 16px; font-variant-numeric: tabular-nums;
    }
    /* The filtered count beside search replaces the header count on mobile. */
    .kennel-dogs-tab:has(.registry-tab-search) .tab-counter,
    .kennel-litters-tab:has(.registry-tab-search) .tab-counter,
    .member-dogs-tab:has(.registry-tab-search) .tab-count { display: none; }
    .tab-header-actions:empty { display: none; }
}

@media (max-width: 768px) {
    /* Заглавия на списъците: кучета, развъдници, членове/лица. */
    .registry-index-heading {
        align-items: center;
        gap: 9px;
        margin-bottom: 12px;
    }

    .registry-index-heading-icon {
        width: 32px;
        height: 32px;
        flex: 0 0 32px;
        font-size: 13px;
        box-shadow: none;
    }

    .registry-index-title {
        margin: 0;
        font-size: 22px;
        line-height: 1.2;
    }

    .registry-index-eyebrow,
    .registry-index-description {
        display: none;
    }

    /* Заглавия над кучета и кучила в член/развъдник. */
    :is( .kennel-dogs-tab, .kennel-litters-tab, .member-dogs-tab, .member-litters-tab ) :is(.tab-header, .tab-heading) {
        gap: 8px;
        margin-bottom: 12px;
    }

        :is( .kennel-dogs-tab, .kennel-litters-tab, .member-dogs-tab, .member-litters-tab ) :is(.tab-header, .tab-heading) h2 {
            margin: 0;
            font-size: 20px;
            line-height: 1.25;
        }

        :is( .kennel-dogs-tab, .kennel-litters-tab, .member-dogs-tab, .member-litters-tab ) :is(.tab-header, .tab-heading) :is(.tab-eyebrow, p) {
            display: none;
        }
}

/* Празни контейнери в заглавната секция на развъдника. */
.kennel-details-page .registry-details-subtitle:empty,
.kennel-details-page .registry-page-heading-leading:empty,
.kennel-details-page .registry-details-actions:empty {
    display: none;
}

@media (max-width: 768px) {
    .kennel-details-page .registry-details-header {
        gap: 10px;
        margin-bottom: 14px;
    }

    .kennel-details-page .registry-form-eyebrow {
        margin-bottom: 4px;
        font-size: 9px;
        letter-spacing: 1px;
    }

    .kennel-details-page .registry-details-title {
        margin: 0;
        font-size: 24px;
        line-height: 1.2;
        overflow: visible;
        overflow-wrap: anywhere;
    }

    .kennel-details-page .registry-details-decoration {
        display: none;
    }
}