.ap-sheet,
.ap-sheet-backdrop {
	display: none;
}

@media (max-width: 980px) {
	html.ap-android .ap-sheet {
		font-family: Roboto, "Noto Sans", system-ui, sans-serif;
	}

	.ap-sheet a:focus-visible,
	.ap-sheet button:focus-visible {
		outline: 2px solid var(--ap-focus, #b7f8cf);
		outline-offset: 3px;
	}

	.ap-sheet[hidden],
	.ap-sheet-backdrop[hidden] {
		display: none !important;
	}

	.ap-sheet:not([hidden]) {
		display: block;
		position: fixed;
		z-index: 100120;
		left: 0;
		right: 0;
		bottom: calc(var(--ap-keyboard-inset, 0px) + var(--ap-standalone-bottom, 0px));
		max-height: min(85dvh, calc(100svh - var(--ap-header-h, 52px) - 12px));
	}

	.ap-sheet__panel {
		display: flex;
		flex-direction: column;
		max-height: inherit;
		overflow: auto;
		background: #1c1c1c;
		color: var(--ap-text, #f6f6f6);
		border-radius: 16px 16px 0 0;
		padding: 8px 16px calc(16px + var(--ap-safe-bottom, env(safe-area-inset-bottom, 0px)));
		box-shadow: 0 -12px 32px rgba(0, 0, 0, 0.45);
		animation: ap-sheet-in 200ms ease;
	}

	.ap-sheet__bar {
		position: relative;
		display: flex;
		align-items: center;
		justify-content: flex-end;
		min-height: 44px;
	}

	.ap-sheet__grab {
		position: absolute;
		left: 50%;
		top: 50%;
		width: 36px;
		height: 4px;
		margin: 0;
		border-radius: 4px;
		background: #797e7b;
		transform: translate(-50%, -50%);
	}

	.ap-sheet__bar button[data-ap-close-sheet] {
		position: relative;
		z-index: 1;
	}

	.ap-sheet-backdrop:not([hidden]) {
		display: block;
		position: fixed;
		z-index: 100115;
		inset: 0;
		background: rgba(0, 0, 0, 0.45);
	}

	.ap-sheet__form,
	.ap-sheet__list {
		display: flex;
		flex-direction: column;
		gap: 8px;
		margin: 8px 0 0;
		padding: 0;
		list-style: none;
	}

	.ap-sheet__label {
		font-size: var(--ap-text-base, 14px);
		color: var(--ap-muted, #aaaead);
	}

	.ap-sheet__field {
		display: flex;
		align-items: stretch;
		min-height: 48px;
		padding: 0 14px;
		border: 1px solid #797e7b;
		border-radius: 12px;
		background-color: #121212;
	}

	.ap-sheet__input,
	.ap-sheet__input[type="search"] {
		flex: 1;
		min-width: 0;
		width: 100%;
		min-height: 46px;
		padding: 12px 0 !important;
		text-indent: 0 !important;
		border: 0;
		border-radius: 0;
		background-color: #121212 !important;
		background-image: none !important;
		color: var(--ap-text, #f6f6f6) !important;
		font-size: var(--ap-text-lg, 16px);
		line-height: 1.35;
		box-shadow: none !important;
		-webkit-appearance: none;
		appearance: none;
	}

	.ap-sheet__input:focus,
	.ap-sheet__input:focus-visible,
	.ap-sheet__input:active {
		background-color: #121212 !important;
		outline: none;
		box-shadow: none !important;
	}

	.ap-sheet__input[type="search"]::-webkit-search-decoration,
	.ap-sheet__input[type="search"]::-webkit-search-cancel-button,
	.ap-sheet__input[type="search"]::-webkit-search-results-button,
	.ap-sheet__input[type="search"]::-webkit-search-results-decoration {
		-webkit-appearance: none;
		appearance: none;
		display: none;
	}

	.ap-sheet__input:-webkit-autofill,
	.ap-sheet__input:-webkit-autofill:hover,
	.ap-sheet__input:-webkit-autofill:focus {
		-webkit-text-fill-color: var(--ap-text, #f6f6f6);
		-webkit-box-shadow: 0 0 0 1000px #121212 inset;
		box-shadow: 0 0 0 1000px #121212 inset;
		caret-color: var(--ap-text, #f6f6f6);
		transition: background-color 99999s ease-out 0s;
	}

	.ap-sheet__submit,
	.ap-sheet__action,
	.ap-sheet__list a {
		display: flex;
		align-items: center;
		min-height: 48px;
		padding: 12px 4px;
		border: 0;
		border-bottom: 1px solid var(--ap-line, #303030);
		background: transparent;
		color: var(--ap-text, #f6f6f6);
		font: inherit;
		font-size: var(--ap-text-lg, 16px);
		text-align: left;
		text-decoration: none;
		cursor: pointer;
	}

	.ap-sheet__submit {
		justify-content: center;
		border: 0;
		border-radius: 100px;
		background: var(--ap-action, #1ed760);
		color: var(--ap-on-action, #0d2114);
		font-weight: 700;
	}

	.ap-sheet__note {
		margin: 12px 0 0;
		color: var(--ap-muted, #aaaead);
		font-size: var(--ap-text-sm, 13px);
		line-height: 18px;
	}

	.ap-sheet__action[aria-checked="false"] {
		color: var(--ap-muted, #aaaead);
	}
}

@media (min-width: 700px) and (max-width: 980px) {
	.ap-sheet:not([hidden]) {
		left: 50%;
		right: auto;
		width: min(560px, calc(100% - 48px));
		bottom: calc(var(--ap-tabbar-h, 56px) + 16px + var(--ap-keyboard-inset, 0px));
		transform: translateX(-50%);
	}

	.ap-sheet__panel {
		border-radius: 16px;
	}
}

@keyframes ap-sheet-in {
	from {
		transform: translateY(16px);
		opacity: 0.6;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ap-sheet__panel {
		animation: none !important;
		transition: none !important;
	}
}
