.ui.input.phone-input { position: relative; }
.ui.input.phone-input > input[type="tel"] { flex: 1 1 auto; min-width: 0; }
.ui.input.phone-input > input[type="tel"]:is(.phone-ext-btn, .phone-ext-btn ~ *, :has(~ .phone-ext-btn)) { padding-right: 3.4em; }

.ui.labeled.input.phone-input > .phone-cc.ui.label {
	display: flex; align-items: center; gap: .3em; padding: 0 .55em; font-size: .85em; font-weight: normal;
	background: transparent; border: 1px solid rgba(var(--c-line-rgb, 34,36,38), .15); border-right: 0; cursor: pointer;
	transition: background-color 120ms ease, border-color 120ms ease;
}
.ui.labeled.input.phone-input > .phone-cc.ui.label:hover,
.ui.labeled.input.phone-input > .phone-cc.ui.label:focus-within,
.ui.labeled.input.phone-input > .phone-cc.ui.label.active { background: rgba(var(--c-ink-rgb, 0,0,0), .05); border-color: rgba(var(--c-line-rgb, 34,36,38), .35); }
.phone-input .phone-cc > .text { display: flex; align-items: center; gap: .3em; }
.phone-input .phone-cc > .text > i.flag { margin: 0; }
.phone-input .phone-dial { color: var(--c-muted, #999999); }
.phone-input .phone-cc > .menu { min-width: 18em; }
.phone-input .phone-cc .scrolling.menu { max-height: 16em; }
.phone-input .phone-cc .scrolling.menu > .item { display: flex; align-items: baseline; gap: .35em; }
.phone-input .phone-cc .scrolling.menu > .item > .phone-dial { margin-left: auto; padding-left: .75em; }

.phone-input > .phone-ext-btn {
	position: absolute; right: .45em; top: 50%; transform: translateY(-50%); z-index: 1;
	padding: .2em .5em; border: 0; border-radius: .25rem; background: rgba(var(--c-ink-rgb, 0,0,0), .06); color: var(--c-text-2, #666666);
	font: inherit; font-size: .8em; line-height: 1.3; cursor: pointer;
	opacity: 0; pointer-events: none; transition: opacity 120ms ease, background-color 120ms ease;
}
.phone-input:hover > .phone-ext-btn, .phone-input:focus-within > .phone-ext-btn { opacity: 1; pointer-events: auto; }
.phone-input > .phone-ext-btn:hover, .phone-input > .phone-ext-btn:focus-visible { background: rgba(var(--c-ink-rgb, 0,0,0), .12); }
@media (hover: none) {
	.phone-input:hover:not(:focus-within) > .phone-ext-btn { opacity: 0; pointer-events: none; }
}
.phone-input > .phone-ext-x, .phone-input > input.phone-ext { display: none; }
.phone-input.has-ext > .phone-ext-btn, .phone-input.no-ext > .phone-ext-btn { display: none; }
.ui.input.phone-input.has-ext > input[type="tel"] { padding-right: 1em; }
.phone-input.has-ext > .phone-ext-x { display: flex; align-items: center; padding: 0 .45em; color: var(--c-muted, #999999); }
.ui.input.phone-input.has-ext > input.phone-ext,
.ui.form .fields .ui.input.phone-input.has-ext > input.phone-ext { display: block; flex: 0 0 5.5em; width: 5.5em; min-width: 0; }

.ui.action.input > .ui.input.phone-input { flex: 1 1 auto; min-width: 0; }
.ui.action.input > .phone-input:not(.has-ext) > input[type="tel"],
.ui.action.input > .phone-input.has-ext > input.phone-ext { border-top-right-radius: 0; border-bottom-right-radius: 0; }
