/**
 * Fields mode panel: the layer on <body>, the dropdown, the bottom sheet and its scrim.
 */

.avco-widget__shell {
	box-sizing: border-box;
	background: var(--avco-w-surface);
	color: var(--avco-w-text);
	font-size: var(--avco-w-fs);
	line-height: 1.4;
	text-align: start;
}

.avco-widget__shell.is-pop {
	max-width: 100%;
	padding: var(--avco-w-s3);
	border: 1px solid var(--avco-w-divider);
	border-radius: var(--avco-w-r-panel);
	box-shadow: var(--avco-w-shadow);
}

.avco-widget__shell.is-sheet {
	padding: var(--avco-w-s2) var(--avco-w-s4) calc(var(--avco-w-s4) + env(safe-area-inset-bottom));
	border-radius: var(--avco-w-r-sheet) var(--avco-w-r-sheet) 0 0;
	box-shadow: var(--avco-w-shadow);
	overflow: auto;
	overscroll-behavior: contain;
}

/* The page behind the sheet is dimmed. */
.avco-panel-layer.is-sheet {
	background: var(--avco-w-scrim);
}

/* No gap of its own: the head, the panel and the foot carry their own margins. */
.avco-widget__sheet {
	display: flex;
	flex-direction: column;
}

.avco-widget__sheettop {
	touch-action: none;
}

/* Only a sheet that scrolls pins its head and foot. */
.avco-widget__shell.is-sheet.is-tall .avco-widget__sheettop {
	position: sticky;
	top: calc(var(--avco-w-s2) * -1);
	z-index: 2;
	margin-top: calc(var(--avco-w-s2) * -1);
	padding-top: var(--avco-w-s2);
	background: var(--avco-w-surface);
}

.avco-widget__grab {
	width: 36px;
	height: var(--avco-w-s1);
	margin: 0 auto var(--avco-w-s2);
	border-radius: var(--avco-w-s0);
	background: var(--avco-w-border);
}

.avco-widget__sheethead {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--avco-w-s2);
	margin-bottom: var(--avco-w-s2);
}

/* Sheet title and foot buttons use the normal line height. */
.avco-widget__sheettitle,
.avco-widget__foot .avco-widget__link,
.avco-widget__foot .avco-widget__btn {
	line-height: normal;
}

.avco-widget__sheettitle {
	font-weight: 600;
}

.avco-widget__nav.is-bare {
	border-color: transparent;
}

.avco-widget__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--avco-w-s3);
	margin-top: var(--avco-w-s4);
	padding-top: var(--avco-w-s3);
	border-top: 1px solid var(--avco-w-divider);
	background: var(--avco-w-surface);
}

/* The pinned foot covers the sheet's bottom padding while content scrolls under it. */
.avco-widget__shell.is-sheet.is-tall .avco-widget__foot {
	position: sticky;
	bottom: calc((var(--avco-w-s4) + env(safe-area-inset-bottom)) * -1);
	z-index: 2;
	margin-bottom: calc((var(--avco-w-s4) + env(safe-area-inset-bottom)) * -1);
	padding-bottom: calc(var(--avco-w-s4) + env(safe-area-inset-bottom));
}

.avco-widget__link.is-foot {
	height: var(--avco-w-tap);
	color: var(--avco-w-text);
}

.avco-widget__btn.is-primary {
	border-color: var(--avco-w-brand);
	background: var(--avco-w-brand);
	color: var(--avco-w-on-brand);
}

.avco-widget__btn.is-primary:disabled {
	border-color: var(--avco-w-off);
	background: var(--avco-w-off);
	color: var(--avco-w-text-off);
}

/* The panel holds focus only while its body loads; no ring. */
.avco-widget__shell[tabindex="-1"]:focus {
	outline: none;
}
