.country-picker {
    min-width: 0;
    max-width: 100%;
}
.country-picker-control {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 48px;
    padding: 12px 16px;
    border: 0;
    border-radius: var(--radius);
    background: var(--soft);
    color: var(--ink);
    font: inherit;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
}
.country-picker-control[aria-expanded='true'] {
    box-shadow: inset 0 0 0 1px var(--border-strong);
}
.country-picker-control[aria-expanded='true'] .choice-arrow::after {
    margin-top: 4px;
    transform: rotate(225deg);
}
.country-picker-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.country-flag,
.country-globe {
    display: block;
    width: 24px;
    height: 18px;
    flex: 0 0 24px;
    object-fit: contain;
}
.country-globe {
    color: var(--muted);
}
.country-picker-popup {
    position: fixed;
    inset: auto;
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 4px;
    box-sizing: border-box;
    max-width: none;
    overflow: hidden;
    border: 0;
    border-radius: var(--radius-large);
    color: var(--ink);
    background: var(--surface);
    box-shadow: 0 12px 36px #0003;
    font: inherit;
    z-index: 100;
}
.country-picker-popup::backdrop {
    background: transparent;
}
dialog.country-picker-popup[open],
dialog.country-picker-popup[open]::backdrop {
    animation: none;
}
.country-picker-popup .country-picker-search {
    flex: 0 0 auto;
    width: 100%;
    min-height: 48px;
    margin: 0 0 4px;
    padding: 12px;
    border: 0;
    border-radius: calc(var(--radius-large) - 4px);
    background: var(--soft);
    color: var(--ink);
    font: inherit;
}
.country-picker-options {
    min-height: 0;
    max-height: 320px;
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border-strong) transparent;
}
.country-picker-option {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 12px;
    border-radius: calc(var(--radius-large) - 4px);
    cursor: pointer;
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.4;
}
.country-picker-option:has(:checked) {
    background: var(--soft);
}
.country-picker-option:focus-within {
    outline: 1px solid var(--border-strong);
    outline-offset: -1px;
}
.country-picker-option .country-picker-checkbox {
    appearance: none;
    position: relative;
    flex: 0 0 20px;
    width: 20px;
    height: 20px;
    min-height: 0;
    margin: 0;
    padding: 0;
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    background: var(--soft);
    cursor: pointer;
}
.country-picker-option .country-picker-checkbox:checked {
    border-color: var(--primary);
    background: var(--primary);
}
.country-picker-checkbox:checked::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 3px;
    width: 5px;
    height: 9px;
    border: solid var(--on-primary);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.country-picker-checkbox:focus-visible {
    outline: none;
}
.country-picker-name {
    min-width: 0;
    overflow-wrap: anywhere;
}
.country-picker-empty {
    padding: 16px 12px;
    font-size: 0.875rem;
    color: var(--muted);
}
.country-picker-footer {
    display: flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 4px;
    margin: 4px 8px 0;
    padding-top: 4px;
    border-top: 1px solid var(--line);
}
.country-picker-count {
    flex: 1;
    color: var(--muted);
    font-size: 0.8125rem;
}
.country-picker-action {
    min-width: 48px;
    min-height: 48px;
    padding: 10px;
    border: 0;
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink);
    font: inherit;
    font-size: 0.875rem;
}
.country-picker-done {
    background: var(--primary);
    color: var(--on-primary);
}
@media (max-width: 760px) {
    .country-picker-control,
    .country-picker-popup .country-picker-search,
    .country-picker-option {
        font-size: 1rem;
    }
}
@media (forced-colors: active) {
    .country-picker-option .country-picker-checkbox {
        appearance: auto;
    }
    .country-picker-checkbox:checked::after {
        display: none;
    }
}
@media (hover: hover) and (pointer: fine) {
    .country-picker-control:hover:not(:disabled) {
        background: var(--hover);
    }
    .country-picker-option:hover {
        background: var(--soft);
    }
    .country-picker-action:not(.country-picker-done):hover:not(:disabled) {
        background: var(--soft);
    }
}
